Anti_vowel...almost works?


#1



Oops, try again. Your function fails on anti_vowel("Yab Gab to Trab Yab Yab Aeiouz"). It returns "Yb Gb t Trb Yb Yb Az" when it should return "Yb Gb t Trb Yb Yb z".

I get this error message and I don't understand how it can work until the last A.


def anti_vowel(text):
    vowels=["a","e","i","o","u"]
    text.lower()
    newtext=""
    tick=1
    for i in range (0, len(text)):
        for j in vowels:
            if text[i]==j:
                tick=0
        if tick==1:
            newtext=newtext+text[i]
        tick=1
    return newtext


#2

because the A is uppercase, that is why your code is failing. So close, but you don't deal with the uppercase letters (yet)

i know you convert text to lowercase here, but i advise against it. The exercise wants uppercase constants to stay uppercase

and, you convert text to lower, but you don't store this case conversion anywhere


#3

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