Answers for "is power of python recursion"

0

is power of python recursion

def power(base,exp):
    if(exp==1):
        return(base)
    if(exp!=1):
        return(base*power(base,exp-1))
base=int(input("Enter base: "))
exp=int(input("Enter exponential value: "))
print("Result:",power(base,exp))
Posted by: Guest on July-16-2020

Python Answers by Framework

Browse Popular Code Answers by Language