Factorial
easyBasics10 XP
Return n! = 1 × 2 × … × n. By definition 0! is 1.
Examples
- Input: n = 5Output: 120
- Input: n = 0Output: 1
Examples use JSON: true/false/null are True/False/None in Python.
Return n! = 1 × 2 × … × n. By definition 0! is 1.
Examples use JSON: true/false/null are True/False/None in Python.
Run examples checks the examples above. Submit also runs 3 hidden tests.