Answers for "python for factorial"

20

python calculate factorial

def factorial(n):
    fact = 1
    for num in range(2, n + 1):
        fact = fact * num
    return(fact)
Posted by: Guest on May-24-2020
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

Code answers related to "python for factorial"

Python Answers by Framework

Browse Popular Code Answers by Language