Answers for "python factores"

3

factorial in python

def fact(n):
  return 1 if (n==0 or n==1) else n*fact(n-1)
fact(3)
Posted by: Guest on August-07-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

Python Answers by Framework

Browse Popular Code Answers by Language