Anti_vowel [Error: Your code threw a "global name 'anti_vowel' is not defined" error.]


#1

Hello everyone. I'm stuck... again... not knowing where or what the error is. I'm pretty sure it'll be just another inattention mistake...

Link: https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096#

Error messages:

Oops, try again. Did you create a function called anti_vowel? Your code threw a "global name 'anti_vowel' is not defined" error.

File "python", line 4
    if c not in "aeiouAEIOU"
                           ^
SyntaxError: invalid syntax


I honestly thought my code should work perfectly fine...

def anti_vowel(text):
    temp = ""
    for c in text:
        if c not in "aeiouAEIOU"
        temp = temp + c
    return temp

And thank you!


#2

brush up on syntax for if-statements :x


#3

Ah! Oops, I didn't notice I forgot the colon xD (and the automatic indenting xD)

Thanks a lot! It works now!


#4

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