Factorialize a number #
Write a function factorial(n) that takes a non-negative integer n as input and returns the factorial of that number.
The factorial of a number n is the product of all positive integers from 1 to n. For example, a factorial of the number 5 is equal to 1 x 2 x 3 x 4 x 5, which is 120. Note that the factorial of the number 0 is aways 1.
Tests #
factorial(5)should return120factorial(0)should return1factorial(10)should return3628800
Getting Started with Python
Data Types
Python Functions
Statements in Python
Basic Debugging in Python
Basic Algorithm
Object-Oriented Programming
Error Handling
Intermediate Algorithm
Python Modules