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

Connecting Serial ports of two Ubuntu VMWare Virtual Machines

bb.utils.contains yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig