Why did python give me a maximum recursion depth exceeded error?


this is my code, I didn’t use recursion and I tested the code in IDLE, and it worked fine,

could someone explain to me what I did wrong?



Try removing the indent of your last line (the call expression).

Oh, but you did. The indentation on the function call matches the line above it, inside a loop. That makes it recursion (a function calling itself), and an infinite loop.


Thank you, I did that and it fixed the bug


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