Answers for "python math module factorial"

0

python factorial

def factorial(n):
    fact = 1
    for num in range(2, n + 1):
        fact *= num
    return fact
Posted by: Guest on December-03-2021
8

program python factorial

#easy way to find factorial of number with while
b=1
a=int(input('the number to be entered'))
c=1
while c<=a:
    b*=c
    c+=1
print('factorial',a,'is',b)

#output:
the number to be entered x
factorial x is x!
+-+-+-+-+-+-+-+-+++-+-+-+-+-+-+++-+-+++-+++-+-++-+-A
Posted by: Guest on November-28-2021

Python Answers by Framework

Browse Popular Code Answers by Language