Pass Task 2.1P: Factorial
Task description:
The factorial of a nonnegative integer n, written n! (pronounced “ n factorial ” ), is the product of n* (n – 1)* (n – 2)* … * 1 . And
1! = 1
0! = 1
Example: 5! = 5 * 4 * 3 * 2 * 1
Define a function which accepts a passed argument and calculates its factorial. A program accepts user’s input and calls the function. (Please DO NOT use recursive function call in the function definition.)
(Sample output as shown in the following figure is for demonstration purposes only.)
Submission:
Submit the following files to OnTrack:
1. Your program source code (e.g. task2-1.py)
2. A screen shot of your program running
Check the following things before submitting:
1. Add proper comments to your code
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.