Functions - factorial of a number

 # Functions - factorial of a number 


def fnfact(N):

if(N==0):

return 1

else:

return(N*fnfact(N-1))


Num = int(input("Enter Number : "))

print("Factorial of", Num, "is", fnfact(Num))

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu