Question #251805

Read through this program carefully and try to analyze what is going on in each line of code (each line of code is performing more than one task).


Expert's answer

n = 6
fact = 1
if n < 0:
   print("No factorial")
elif n == 0:
   print("The factorial= 0")
else:
   for i in range(1,n + 1):
       fact = fact*i
   print("The factorial= ",fact)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS