Question: Exercise 4. (Factorial) Write a program factorial.py that takes n (int) as command-line argument, and writes to standard output the value of nl, which is
>_/workspace/project2 $ python3 factorial.py 0 $ python3 factorial.py 5 120 factorial.py
import stdio
import sys
# Get n (int) from command line
n= . . .
# Set result to 1.
. . .
for i in range (... , ...)
# For each value of i from [2, n]. set result to its current value times i.
#Write result to standard output.
. . .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
