← Back to challenges

Vowel Replacer

PythonHardstringsregex

Instructions

Create a function that replaces all the vowels in a string with a specified character.

Examples

replace_vowels("the aardvark", "#") ➞ "th# ##rdv#rk"

replace_vowels("minnie mouse", "?") ➞ "m?nn?? m??s?"

replace_vowels("shakespeare", "*") ➞ "sh*k*sp**r*"

Notes

All characters will be in lower case.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Hiding the Card Number