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

62 points
D9d3d6a79191410a54d387fd1dca1129?s=140&d=retro
Submitted by
boffoff
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'    

else: 
    print 'whatever'
return the_flying_circus()

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

tia!


1 vote

permalink

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
7a0875ab34003033fb1214adb9b2208d?s=140&d=retro
Submitted by
allofthekingsmen
over 3 years ago