69.8k views
8 votes
Please help asap! i have 30 minutes!!

write a function sillystring() that replaces all vowels (a, e, i, o, and u) in a string with "oob" and returns that string to the caller.
for python!

User Bimasakti
by
3.4k points

1 Answer

6 votes

Answer:

def sillystring(input):

output = ""

vowels = ['a', 'e', 'i', 'o', 'u']

for letter in input:

if (letter.lower() in vowels):

output += "oob"

else:

output += letter

return output

Testing:

>>> print(sillystring('Hello, world!'))

Hooblloob, woobrld!

User Russiancold
by
3.4k points