Page 98 - Computer - 8
P. 98
Lab Activity 8
To accept a number from the user and display its table using the While loop. Experiential Learning
1. Type the code as shown in the image in the Python Editor.
2. Press the F5 key to execute the code. Sample output of the program is given below.
Lab Activity 9
To accept a number from the user and display its factorial using the While loop. Experiential Learning
(The factorial of a positive number is the product of all numbers from 1 to the number. For example,
the factorial of 5 is 1 × 2 × 3 × 4 × 5 = 120)
1. Type the code as shown in the image in the Python Editor.
2. Press the F5 key to execute the code. Sample outputs of the program are given below.
96