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

I don't get why it removes some but not the last vowel.

def anti_vowel(text):
    text = list(text)
    for i in text:
        if i in "aeiouAEIOU":
    return ''.join(text)


remove isn't the best method to solve this problem. Rather append constants to a new list

lets say we have: hey look words, it will find the first o of look. Which gets removed. but then the second o of look shifts to the index/position of your first o, while the for loop continues to the k (due to index shift), then find the o in words, and remove removes the first o it will find (the o from look which got skipped due to index shift


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