Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. def BinPow(a, n, fun):
  2.     if n == 1:
  3.         return fun(a)
  4.     else:
  5.         def BinPow1(a1, n1, fun1=fun):
  6.             if n == 1:
  7.                 return fun1(a)
  8.             else:
  9.                 return BinPow1(fun1(a1), n1 - 1)
  10.         return(BinPow1(fun1(a1), n - 1))
  11.  
  12. print(BinPow("Se", 7, str.__add__))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement