All right! Now we’re cooking. Let’s try a factorial problem.
To calculate the factorial of a non-negative integer
x, just multiply all the integers from 1 through
x. For example:
4 * 3 * 2 * 1, which is 24.
3 * 2 * 1, which is 6.
Define a function
factorial that takes an integer
x as input.
Calculate and return the factorial of that number.