Factorial (Recursive) medium
functions

Write a recursive function solution(n) that returns n! (n factorial).

  • 0! = 1
  • n! = n × (n-1)!

Example

solution(5) → 120
solution(0) → 1
solution(7) → 5040
solution.py
14px
📊 Test Results
Run your code to see test results here.