Be able to write Python programming of a factorial of an integer (given input parameters, output characteristics and expected output behavior, do not use internal python functions for factorials), recall for example that: 5! = 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 = 120 and to continue asking unless user says to stop
NOT USING FACTORIAL FUNCTION
n = int(input("Enter an integer(0 to quit): ")) while n!=0: fact = 1 for i in range(1,n+1): fact = fact * i print(str(n)+"! = "+str(fact)) n = int(input("Enter an integer(0 to quit): "))
Get Answers For Free
Most questions answered within 1 hours.