The big if problem


#1


The following exception was raised when calling the_flying_circus(): NameError: global name 'true' is not defined

What should i do to rectify this error?


# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if 8 > 9:    # Start coding here!
        return true# Don't forget to indent
        the_flying_circus()# the code inside this block!
    elif (8 < 9):
        return true# Keep going here.
        # You'll want to add the else statement, too!
    else:
        return false
        the_flying_circus()


#2

here..
problem1.
in Python Booleans are written like this:
True / False (notice first letter is capitalized)
example...
return True not return true.

One more thing..

if 8 > 9:    # Start coding here!
        return true# Don't forget to indent
        the_flying_circus()# the code inside this block!

 else:
        return false
        the_flying_circus()

Even though in this codethe_flying_circus() will have no effect but you don't need them. (it can cause an error if there was no return statement before it.)


#3

Thanks a lot. It worked


#4

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