The Big If Problems


#1



https://www.codecademy.com/en/courses/python-beginner-BxUFN/4/1?curriculum_id=4f89dab3d788890003000096


Every time i try this happens:
Oops, try again. The following exception was raised when calling the_flying_circus(): RuntimeError: maximum recursion depth exceeded


I thought that it would work but apparently I was wrong. Can anyone help?


# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if the_flying_circus() != True or False:
        print 'printed'
        # Don't forget to indent
        # the code inside this block!
    elif the_flying_circus() == (666 < 667) and not (1 != 1):
        print 'correct'
        # Keep going here.
        # You'll want to add the else statement, too!
    else:
        print 'You failed'


#2

here:

if the_flying_circus()

you call the function inside the function, this is known as recursion. Given you have no base case, the recursion has a similair effect as an infinity loop


#3

Thanks! This really helped.


#4

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