Question: python In this assignment, you will design a simple application which will calculate the factorial of n as follows: n!=1.2*...*(n-1)*n, where n is the user
In this assignment, you will design a simple application which will calculate the factorial of n as follows: n!=1.2*...*(n-1)*n, where n is the user specified integer. The application will ask user the number n. The user input will be an integer number between 1 and 100. The program will print the equation and the value of n!. For example: if the user enters 5; then the program should display factorial of 5 is 120. Lab Procedure: 1. Prior starting of the work consider how to design the for loop: a. What would be the range of the loop? 2. Determine how to calculate the factorial of the given number. What is the variable to hold the current product, where and how to initialize the variable of current product? 3. Test the application by hand-calculating several factorials to verify if the results are identical to the program's output. 4. Arrange the main functionality of the code inside a main() function. 1. How to define a function: def main(): #body of the function 2. To call simply type: main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
