This forum is now read-only. Please use our new forums! Go to forums
15/15 RuntimeError: maximum recursion depth
“The following exception was raised when calling the_flying_circus(): RuntimeError: maximum recursion depth exceeded while calling a Python object”
def the_flying_circus():
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!
Answer 55fad6a8d3292f4a0f00001b
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
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency