Intermediate
Python Debugging Assistant
Identify and fix a logical error in a Python code snippet.
📝 প্রম্পট বিষয়বস্তু
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.