hard
Debug a Code Snippet
Analyze a piece of code to find and fix errors.
📝 प्रॉम्ट सामग्री
Review the following Python function intended to calculate the factorial of a number. Identify the bug and provide the corrected code: def factorial(n): return n * factorial(n-1).