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

Comments

Popular posts from this blog

bb.utils.contains yocto

Difference between RDEPENDS and DEPENDS in Yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig