medium
Debug a Python Script
Identify and fix logical errors in a provided code snippet.
📝 Contenido del prompt
Review the following Python code snippet intended to calculate the factorial of a number. Identify why it returns the wrong result for n=0 and provide the corrected code.
result = 1
for i in range(1, n):
result *= i
return result