24 Oct Tuesday Python Homework 18:30 – 21.10.19
Question:
The factorial function (symbol: !) says to multiply all whole numbers from our chosen number down to 1.
Examples:
- 4! = 4 × 3 × 2 × 1 = 24
- 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5040
- 1! = 1
Factorial is not defined for negative numbers, and the factorial of zero is one, 0! = 1
Write a function to find the factorial of a number. The function should take one number as an argument and print the factorial of that number
Sample Input: 5 Sample Output: 120
Hint: The factorial of 5 is 1 * 2 * 3 * 4 * 5 = 120 and also use loops inside the function
Sorry, the comment form is closed at this time.