Hard
Python Code Debugging
Identify and fix a bug in a Python script.
📝 Prompt Inhoud
Review the following Python function intended to calculate the factorial of a number. Identify the logic error, explain why the current code fails for negative inputs or zero, and provide a corrected version of the function with appropriate error handling.