Calculator • Exercise 3/4

Factorial

00:00
0
20 points

Instructions

Create a function factorial that calculates n! (n factorial).

factorial(0) = 1
factorial(5) = 5 * 4 * 3 * 2 * 1 = 120

You can use recursion or iteration.

Your Code

Results

Click "Run Tests" to see results