Anti_vowel excersize error


My code looks like this:

def anti_vowel(text):
    for char in text:
        if char in 'aeiouAEIOU':
    return final_str

The console says:


and this popup comes:


Do you agree with that your function has that behaviour?
If not, verify.

If yes, compare what you want it to do, with what it actually does. Print statements are useful for this.


I don't agree that the function has that behavior.


Then verify. The error message says how it tested your function.


You mean adding this?:

anti_vowel("Hey look Words!")


I think you're almost there.

The main thing to change is what happens inside your ELSE statement. If CHAR is not a vowel you still need to add it to FINAL_STR so that you end up with FINAL_STR returning TEXT without the vowels.

Remember also to call the function correctly, which is this case is PRINT ANTI_VOWEL("STRING_OF_YOUR_CHOICE"). Simply stating PRINT("A") will result in printing "A" which is what you're getting and does not call on the function at all.

Hope that helps!


this is what i did put 1 tab before: return "".join([p for p in text if p not in "aeiouAEIOU"])

def anti_vowel(text):
return "".join([p for p in text if p not in "aeiouAEIOU"])

print anti_vowel("the quick brown fox jumps over a lazy dog")