Question: Q6. (10 points) Complete the code below for line 3,7 (two lines) to show the result of the 10 factorials Factorial example: 3! = 1x2x3
Q6. (10 points) Complete the code below for line 3,7 (two lines) to show the result of the 10 factorials Factorial example: 3! = 1x2x3 = 6, 5! = 1x2x3x4x5 = 120 Do not change anything on the codes. Just add the missing parts on line 3,7. Line 1: f= 1 Line 2: m = 1 Line 3: while Line 4: for k in range(m): Line 5: f*= k + 1 Line 6: print(str(m)+'! = ', f) Line 7 Line 8: f = 1 11 = 1 21 = 2 3! = 6 41 = 24 5! = 120 6! = 720 7! = 5040 8! = 40320 9! = 362880 10! = 3628800
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
