diff --git a/maths/binary_exponentiation.py b/maths/binary_exponentiation.py index c5bb79897..7eeca8926 100644 --- a/maths/binary_exponentiation.py +++ b/maths/binary_exponentiation.py @@ -5,12 +5,12 @@ def binary_exponentiation(a: int, n: int) -> int: - ''' + """ >>> binary_exponentiation(3, 5) 243 >>> binary_exponentiation(10, 3) 1000 - ''' + """ if n == 0: return 1 @@ -24,8 +24,9 @@ def binary_exponentiation(a: int, n: int) -> int: if __name__ == "__main__": import doctest + doctest.testmod() - + try: BASE = int(input("Enter Base : ").strip()) POWER = int(input("Enter Power : ").strip())