Anti_vowel doesnt work in here


#1




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():
    text=input()
    letters = []
    vowels = "aeiouAEIOU"
    for l in text:
        if l in vowels:
            continue
        else:
            letters.append(l)
    return "".join(letters)

print(anti_vowel())


#2

the exercise needs to verify your code works correctly, as such.you 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


#3

totally forgot about raw_input. thank you!


#4

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