Anti_vowel doesnt work in here


Traceback (most recent call last):
File "python", line 1, in
File "", line 1, in
NameError: name 'voWEL' is not defined

so this code works on my computer but when i try in here it doesn't. can someone help?
i've also tried to put "def anti_vowel(text=input()) " but same error message.

def anti_vowel():
    letters = []
    vowels = "aeiouAEIOU"
    for l in text:
        if l in vowels:
    return "".join(letters)



the exercise needs to verify your code works correctly, as might want to consider to give your function a parameter, and pass the input as argument:

def anti_vowel(text):
    # function content
text = input()
print anti_vowel(text)

also, codecademy uses python2, looks like your computer runs python3, maybe you want to check on some of the differences?

print, input and raw_input and how they differ in python2 and python3


totally forgot about raw_input. thank you!


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