Python Program for factorial of a number

Asked: Anonymously |Category: Python

n=eval(input("Enter the number"))

temp=n

fac=1

while temp>0:

fac*=temp

temp-=1

print('factorial of',n,'is',fac)

3 views0 comments

Recent Posts

See All

Binary string reduction in Python

Asked: Sudeep |Category: Python x=int(input("Enter the value of x : ")) for i in range(x): n=int(input("Enter the value of n : ")) y=input("Enter the value of y : ") l=list(y) k=0

"Believe you can and you're halfway there"