Oops, try again. Your function fails on anti_vowel("Hey look Words!"). It returns "Hy lk Words!" when it should return "Hy lk Wrds!".

tho code doesn't remove all repeated vowels

def anti_vowel(text):
    new = list(text)
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    for x in new:
        for i in vowels:
            if x == i:
    return "".join(new)


.remove() is a difficult approach to solve this problem. The problem is that you are looping over the same string as you are removing from

couple options:
1. choice a different approach (appending constants to a new list)
2. loop over text while removing from new
3. loop over new in reverse so the index shift doesn't occur.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.