Anti_vowel (getting the right answer, but still showing an error message)


The code is working fine, I'm getting the right answer, but I still get an error message that says - Oops, try again. Your function fails on anti_vowel("Hey look Words!"). It returns "None" when it should return "Hy lk Wrds!".
What could be wrong with my code?
Here's my code -

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

print anti_vowel("Hey look Words!")


Using a pass statement is not advisable for what you are trying to make your function do.


Thanks for the help.


You also should think about the replace function and making sure that you have a result to return.


I've already got the solution, but thanks for the help!


A post was split to a new topic: Anti_vowel