I'm attempting to take a string as input and return that same string with each vowel multiplied by 4 and a "!" added at the end. Ex. 'hello' returns, 'heeeelloooo!'
def exclamation(s):
'string ==> string, returns the string with every vowel repeating four times and an exclamation mark at the end'
vowels = 'aeiouAEIOU'
res = ''
for a in s:
if a in vowels:
return s.replace(a, a * 4) + '!'
The above code just returns 'heeeello!' I also attempted it in the interactive shell with vowels equaling ('a', 'e', 'i', 'o', 'u') but using the same code resulted in this:
>>> for a in s:
if a in vowels:
s.replace(a, a * 4) + '!'
'heeeello!' 'helloooo!'
How can I get it to multiply each vowel and not just one of them?