Power function : Function Define : Function PYTHON examples


PYTHON examples » Function » Function Define »

 

Power function


Power function
 

def power(x, n):
    if n == 0:
        return 1
    else:
        return x * power(x, n-1)


print power(2,7)
           
         
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Function
» Function Define