hard
Debug a Python Function
Analyze a provided code snippet to find logical errors and suggest fixes.
📝 Prompt Inhoud
I have a Python function that is supposed to calculate the factorial of a number but returns incorrect results for inputs greater than 5. Here is the code: [PASTE CODE]. Analyze the logic, identify the bug, and provide the corrected code with an explanation of what went wrong.