Python program to print factorial of 2 or 3 digit number
#program that print the factorial of a 2 or 3 digit number
user=input("\n enter 2 or 3 digit number")
if(user>999):
print "Enter only 2 or 3 digit number"
else:
sum=1
number=1
while user>=number:
sum=sum*number
number=number+1
print "the factorial of the",user,"is",sum
user=input("\n enter 2 or 3 digit number")
if(user>999):
print "Enter only 2 or 3 digit number"
else:
sum=1
number=1
while user>=number:
sum=sum*number
number=number+1
print "the factorial of the",user,"is",sum
Comments
Post a Comment