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


#1

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":
            pass
        else:
            print letter

print anti_vowel("Hey look Words!")

#2

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


#3

Thanks for the help.


#4

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


#6

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


#7

A post was split to a new topic: Anti_vowel