anti_vowel


#1



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 "bcdHy lk Wrds!" when it should return "Hy lk Wrds!".

i dont know where it's getting the bcd right before Hy lk Wrds! because that was never part of the code. Does anyone have an explanation for this?


vowels = ['a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U']
result = []
def anti_vowel(text):
    for char in text:
        if char not in vowels:
            result.append(char)
        new_one = ''.join(result)
    return new_one


#2

for some reason (the way the code is checked) you need to declare vowels and result inside the function, then it works (i guess because it test different strings on your function)


#3

that worked! thank you so much!