Write a function to find power of number using recursion


Topic: Write a function to find power of number using recursion

Solution

def power(N, P):
    if (P == 0 or P == 1):
        return N
    else:
        return (N * power(N, P - 1))
print(power(5, 2))



List all Python Programs