The Big IF ( I can't get it to work! )


#1

Oops, try again. The following exception was raised when calling the_flying_circus(): NameError: global name 'answer' is not defined

what is wrong?

Here is my code :

def theflyingcircus():
if 9 <= 9:
return True
print "It's true"
elif 6 == 8 or 99 < 88:
return False
else:
return False


#3

Eh, guys the proper indentation would be:

def theflyingcircus():
    if 9<=9:
       return True
    elif 6 == 8 or 99 < 88:
        return False
    else:
        return False

#4

I'm thinking his code might be indented, but copy/paste into the text editor here removes even regular spaces.


#5

Not if you do it correctly by hitting the CODE FORMAT button.


#6

Yes, I realized that shortly after posting my own reply, but he clearly didn't hit the button, so its just pasted as plain text.


#7

Im really sorry. Although I have already advanced through this stage. Thank You for contributing! :smiley:


#8

you need to put elif in parentheses like this elif(6==8)or (99<88):


#9

No, you don't. :slightly_smiling: