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).