Introduction
Function basics
More advanced concepts
Summary
22. Question 1

Instruction

Let's start with something easy!

Exercise

The template presents an exercise from the previous part. It calculates 10 factorial:

10! = 10 * 9 * 8 ... * 2 * 1

Turn the template code into a function named factorial that takes a single number and returns its factorial.