Python Program to Find the Power of a Number Using Recursion

In this program, you’ll learn Python Program to Find the Power of a Number Using Recursion. Write a Python Program to Find the Power of a Number Using Recursion.

def exp(x,y):
if(y==0):
return 1
else:
return(x*exp(x,y-1))
n=int(input("Enter the first number:"))
m=int(input("Enter the second number:"))
print("Result=",exp(n,m))

Output:

Python Program to Find the Power of a Number Using Recursion