8. anti_vowel HELP


#1

def anti_vowel(text):
    new = ""
    for a in text:
        if a not in "aeiouAEIOU":
            new = new + a
        return new
        print new

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

why it only print out "H"??


#2

A function ends the moment a return keyword is reached. Currently, your return is reached in the first run of the loop, you might want to put return at the same indent level as the for loop so the entire for loop can run before something gets returned

Also, small detail, print won't do anything, since it is after return, and since return gives you something in return, i would simple print it on function call:

print anti_vowel("Hello world")

(you currently don't have a function call, add this after the function)


#3

It's work!!
thanks for your helps!!