loom-benchmark-mbpp / 131 /solution /_reference.py
sqy201x's picture
Add files using upload-large-folder tool
b2dd9e4 verified
Raw
History Blame Contribute Delete
279 Bytes
def reverse_vowels(str1):
vowels = ""
for char in str1:
if char in "aeiouAEIOU":
vowels += char
result_string = ""
for char in str1:
if char in "aeiouAEIOU":
result_string += vowels[-1]
vowels = vowels[:-1]
else:
result_string += char
return result_string