This forum is now read-only. Please use our new forums at

62 points
Submitted by
over 3 years ago

15/15 RuntimeError: maximum recursion depth

"The following exception was raised when calling theflyingcircus(): RuntimeError: maximum recursion depth exceeded while calling a Python object"

def theflyingcircus():
if 10 != 20 or 77 != 7:

print 'hello'

elif 5 == 2 + 3 and 5 == 10:
    print 'goodbye'    

    print 'whatever'
return the_flying_circus()

Not sure what is creating this error,don't simply want to increase the incursion depth.


1 vote


The below code should be fine:
You should use "return" instead of "print" when working inside functions, also don't leave the gaps between your "if", "elif" and "else" statements. Finally, to call a function you just need to write the function's name followed by empty parenthesis.
Good luck and happy coding!

def the flying circus():
if 10 != 20 or 77 != 7:
return True
elif 5 == 2 + 3 and 5 == 10:
return 'goodbye'
else :
return 'whatever'
the flying circus()

Remember to indent and underscore where needed

401 points
Submitted by
over 3 years ago