Advertisement
STANAANDREY

lsd3 5

Oct 14th, 2022 (edited)
993
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. def my_pow(a, n):
  2.     if n == 0:
  3.         return 1
  4.  
  5.     if n % 2 == 0:
  6.         return my_pow(a * a, n // 2)
  7.     else:
  8.         return a * my_pow(a * a, n // 2)
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement