My code produces the exact message it's supposed to but the codecademy keeps giving me an error saying "none"


Getting the message "
Oops, try again. Your function fails on anti_vowel("Hey look Words!"). It returns "None" when it should return "Hy lk Wrds!"."

the compiler says

Hy lk Wrds!

heres my code

vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
def anti_vowel(word):
    newword = []
    for i in word:
        if i not in vowels:
    print ''.join(newword)
print anti_vowel('Hey look Words!')

it literally gives me the exact output I'm supposed to get (granted I have no idea why it's printing "none" twice) but still says it's wrong. I don't understand.


Change print for return in line 7. Your function isn't returning anything, so when you call it in line 8, the result is None


[edit] lol that's so simple.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.