Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def BinPow(a, n, fun):
- if n == 1:
- return fun(a)
- else:
- def BinPow1(a1, n1):
- if n1 == 1:
- return fun(a1)
- else:
- return BinPow1(fun(a1), n1 - 1)
- return (BinPow1(fun(a), n - 1))
- print(BinPow("Se", 7, str.__add__))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement