Mask the Vowels
Sometimes you need to mask part of a string by replacing certain characters with one shared symbol. The function replace_vowels receives a string s and replaces every English vowel a, e, i, o, and u with *. Letter case does not matter, so uppercase and lowercase vowels are replaced the same way.
Примеры
Ввод
"hello"Вывод
"h*ll*"Ввод
"xyz"Вывод
"xyz"Ввод
""Вывод
""Нужно реализовать
def replace_vowels(s: str) -> str:
Теги
strings
Conectează-te pentru a vedea istoricul soluțiilor trimise
Conectează-teConectează-te pentru a folosi Mentorul AI
Conectează-teVisible tests
1
Input
"hello"Expected
"h*ll*"2
Input
"xyz"Expected
"xyz"3
Input
""Expected
""4
Input
"AEIOU"Expected
"*****"5
Input
"Python"Expected
"Pyth*n"6
Input
" "Expected
" "Focus radio
Paused · SomaFM · Fluid