Question: I am trying to write a function that takes a string as input and returns a string with all vowels repeated 4 times. 

*eg: `apple` becomes `aaaappleeee`*

It works for every vowel, except for *e*, in which it repeats *e* an egregious amount of times.

Python 3. I have tried playing with the replace function, changing the replacement value to `i+i+i+i`, `i*4`, `i(4)`, `(i+i)*2`, but nothing seems to help. 

```
def exclamation(string):
    for i in string:
        if i in 'aeiou':
            string = string.replace(i, i*4)
    return string + '!'

```

`exclamation('excellent')` should return `eeeexceeeelleeeent!`

however, it returns:
 `eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeexceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelleeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeent!`

As stated, the function works fine for all other vowels, except *e*.

Thank you!

Answer: 
For every vowel you’re iterating through, the loop checks the condition, replaces the content in the same string and then iterates by 1 which now is the same string but instead of the next new letter, it now has to deal with 3 more of the same vowel. For example:

Let’s talk about the string ‘excellent’. For the first vowel ‘e’, it is replaced with ‘eeee’ resulting in the string being ‘eeeexcellent’, now when the second loop begins it starts at index(1) which is still an ‘e’ and this keeps going on. **Never modify the iterable you’re iterating over.**
def exclamation(string):

```
result = ''
for i in string:
    if i in 'aeiou':
        vowel = i * 4
    else:
        vowel = i
    result += vowel
return result + '!'

```

**The reason why replace didnt work for excellent is because we have 3 'e' in which means for each of the 'e' in the loop, replace will multiply by 4 which will definitely give you 12 'e's per one 'e' in excellent**