curriculum/challenges/english/blocks/daily-coding-challenges-python/68adce01c0e1144d0a902956.md
Given a string, return a new version of the string where each vowel is duplicated one more time than the previous vowel you encountered. For instance, the first vowel in the sentence should remain unchanged. The second vowel should appear twice in a row. The third vowel should appear three times in a row, and so on.
a, e, i, o, and u, in either uppercase or lowercase, are considered vowels.repeat_vowels("hello world") should return "helloo wooorld".
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(repeat_vowels("hello world"), "helloo wooorld")`)
}})
repeat_vowels("freeCodeCamp") should return "freeeCooodeeeeCaaaaamp".
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(repeat_vowels("freeCodeCamp"), "freeeCooodeeeeCaaaaamp")`)
}})
repeat_vowels("AEIOU") should return "AEeIiiOoooUuuuu".
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(repeat_vowels("AEIOU"), "AEeIiiOoooUuuuu")`)
}})
repeat_vowels("I like eating ice cream in Iceland") should return "I liikeee eeeeaaaaatiiiiiing iiiiiiiceeeeeeee creeeeeeeeeaaaaaaaaaam iiiiiiiiiiin Iiiiiiiiiiiiceeeeeeeeeeeeelaaaaaaaaaaaaaand".
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(repeat_vowels("I like eating ice cream in Iceland"), "I liikeee eeeeaaaaatiiiiiing iiiiiiiceeeeeeee creeeeeeeeeaaaaaaaaaam iiiiiiiiiiin Iiiiiiiiiiiiceeeeeeeeeeeeelaaaaaaaaaaaaaand")`)
}})
def repeat_vowels(s):
return s
def repeat_vowels(s):
vowels = "aeiouAEIOU"
count = 0
result = []
for char in s:
result.append(char)
if char in vowels:
result.append(char.lower() * count)
count += 1
return "".join(result)