advanced
Debug Logic Error
Identify and fix a logical error in a Python function.
📝 Treść promptu
Analyze the following Python function intended to calculate the factorial of a number. Identify the logical error that causes it to return incorrect results for inputs greater than 1. Provide the corrected code and a brief explanation of why the original code failed.