Exercise: The Factorial!

Let's create a function that calculates the factorial of a number.

Problem Statement #

In this challenge, you must implement the factorial() function. It takes an integer as a parameter and calculates its factorial. Python does have a built-in factorial function but you’ll be creating your own for practice.

The factorial of a number, n, is its product with all the integers between 0 and n.

Get hands-on with 1200+ tech skills courses.