write a python function taht calculates factorial of n
- User
write a python function taht calculates factorial of n
Assistant
pythondef factorial(n): if n < 0: raise ValueError("n must be non-negative") if n == 0: return 1 return n * factorial(n - 1)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.