Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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))
Source by www.sanfoundry.com #
 
PREVIOUS NEXT
Tagged: #power #python #recursion
ADD COMMENT
Topic
Name
9+4 =