Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. def recurPower(base, exp):
  2.     '''
  3.    base: int or float.
  4.    exp: int >= 0
  5.  
  6.    returns: int or float, base^exp
  7.    '''
  8.     # Your code here
  9.     if exp == 0:
  10.         return 1
  11.     else:
  12.         return base * recurPower(base,exp-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement