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.
x
8
1
def exp(x,y):
2
if(y==0):
3
return 1
4
else:
5
return(x*exp(x,y-1))
6
n=int(input("Enter the first number:"))
7
m=int(input("Enter the second number:"))
8
print("Result=",exp(n,m))
Output: