← Back to challenges

Replace Vowel With Another Character

PythonHardstringsregexlanguage_fundamentals

Instructions

Create a function that takes a string and replaces the vowels with another character.

  • a = 1
  • e = 2
  • i = 3
  • o = 4
  • u = 5

Examples

replace_vowel("karachi") ➞ "k1r1ch3"

replace_vowel("chembur") ➞ "ch2mb5r"

replace_vowel("khandbari") ➞ "kh1ndb1ri"

Notes

The input will always be in lowercase.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Remove the Letters ABC