Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def my_pow(a, n):
- if n == 0:
- return 1
- if n % 2 == 0:
- return my_pow(a * a, n // 2)
- else:
- return a * my_pow(a * a, n // 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement