Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def recurPower(base, exp):
- '''
- base: int or float.
- exp: int >= 0
- returns: int or float, base^exp
- '''
- # Your code here
- if exp == 0:
- return 1
- else:
- return base * recurPower(base,exp-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement