The Big IF


I have written the below code and trying to execute it. But every time is execute i see a run time error.
ERROR: "Oops, try again. The following exception was raised when calling the_flying_circus(): RuntimeError: maximum recursion depth exceeded while calling a Python object"

Can you please let me know what is wrong with my code?

# Make sure that the_flying_circus() returns True
def the_flying_circus():
    answer= raw_input("Enter if you want True or False:")
    if answer == "True" or answer == "1":    # Start coding here!
        print "U have selected True"
    elif answer == "False" or answer == "0":
        print "U have selected False"
        print " select from the option below"



the exercise validation can't handle the raw_input (it will input an empty string), so it will always run else, so the function will endlessly call itself (recursion)


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