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


#1

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?

thanks


#2

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.


#3

Thank you, I did that and it fixed the bug


#4

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