Q.No.2 - Write a Python Program to find factorial of a number using Recursion.

Sol.-

n=int(input("Enter Your Number  "))
def fact(n):
    if n==1 or n==0 :
        return n
    else:
        return n*fact(n-1)
print("Factorial of number is ", fact(n) )


OUTPUT: