anti_vowel loop(HELP)


#1

I'm getting the correct output, but I get an error message saying - Oops, try again. Your function fails on anti_vowel("Hey look Words!"). It returns "None" when it should return "Hy lk Wrds!".

def anti_vowel(text):
    for letter in text:
        if letter in "aeiouAEIOU":
            pass
        else:
            print letter

#2

@designslayer00797,

def anti_vowel(text):
    #variable to collect new text result
    n_text=""
    for letter in text:
        if letter in "aeiouAEIOU":
            pass
        else:
            #append the letter to the variable n_text
            n_text+= letter
    #indentation indicates end-of-FOR loop
    #print the resulting n_text
    print n_text
    #return the text
    return n_text

anti_vowel("Hey look Words!")

#3

after ELSE you have PRINT, instead of RETURN :wink: