We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Math
- Power - Mod Power
- Discussions
Power - Mod Power
Power - Mod Power
Sort by
recency
|
327 Discussions
|
Please Login in order to post a comment
a = int (input()) b = int (input()) m = int (input())
q = pow(a,b) r = pow(a,b,m)
print(q) print(r)
For easy learning
a=int(input()) b = int(input()) m = int(input()) print(pow(a,b)) print(pow(a,b,m))
For Python3 Platform
Straight forward solution. Feel free to ask if you don't understand
a = int(input()) b = int(input()) m = int(input()) print(pow(a,b)) print(pow(a,b,m))
a, b, m=map(int, [input() for _ in range(3)]) print(pow(a,b)) print(pow(a,b,m))