Android & iPhone apps are coming soon. Log in for a plan and reminders made for you →

Coding basics · 8 of 20

Factorial

Return n! = 1 × 2 × … × n. By definition 0! is 1.

Examples

Input n = 5

Output 120

Input n = 0

Output 1

Your code · Python

Stuck?