Python program for factorial using recursion

# Factorial recursion program

def fact(n):
    if(n==1):
        return 1
    else:
        return n*fact(n-1)

number=input("\n Enter the number")
result=fact(number)
print "the factorial of",number,"is ",result

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