medium
Python Code Debugger
Identify and fix a logical error in a Python function.
📝 محتوى الأمر
Analyze the following Python function that calculates the factorial of a number. Identify why it returns a RecursionError for inputs greater than 5 and provide the corrected code snippet: def factorial(n): if n == 0: return 1 else: return n * factorial(n - 1)