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


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...


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!


brush up on syntax for if-statements :x


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

Thanks a lot! It works now!


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