Intermediate
Python Debugging Assistant
Identify and fix a logical error in a Python code snippet.
📝 Contenuto del prompt
Analyze the following Python code snippet designed to calculate the factorial of a number. Identify the logical error that causes a recursion error for large inputs and provide the corrected code block along with an explanation of the fix.