@@ -0,0 +1,859 @@
+def power_mod(base, exponent, modulus):%0A    result = 1%0A    base = base %25 modulus%0A    while exponent %3E 0:%0A        if exponent %25 2 == 1:%0A            result = (result * base) %25 modulus%0A        base = (base ** 2) %25 modulus%0A        exponent = exponent // 2%0A    return result%0A%0A%0Adef power_mod_recursive(base, exponent, modulus):%0A    if exponent == 0:%0A        return 1%0A    base = base %25 modulus%0A    result = power_mod_recursive((base ** 2) %25 modulus, exponent // 2, modulus)%0A    if exponent %25 2 == 1:%0A        result = (result * base) %25 modulus%0A    return result %0A%0A%0Aif __name__ == '__main__':%0A    examples = %5B%0A        (1223, 4124, 1),%0A        (1223, 0, 13),%0A        (2, 3, 5),%0A        (1231214, 12592198, 12577),%0A        (2467092835, 1035991785, 149855123)%0A    %5D%0A%0A    for example in examples:%0A        print(f'%7Bpower_mod(*example)%7D == %7Bpower_mod_recursive(*example)%7D')%0A

Create mod_pow.py