Anti vowel


#1

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


https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096


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]
        else:
            word+= text[i] 
    return word


#2

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


#3

oh gotcha. Thank you!


#4

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