Anti vowel


Heyy, everyone! Can someone tell me what is wrong with this code?

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

def anti_vowel(text):
    word = ""
    trash = ""
    for i in range(0,len(text)):
        if i == "A" or "O" or "I" or "E" or "U" or "a" or "o" or "i" or "e" or "u":
            trash+= text[i]
            word+= text[i] 
    return word


You're only comparing i to "A", and i isn't a character from the text


oh gotcha. Thank you!


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