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
|
312 Discussions
|
Please Login in order to post a comment
a = int(input()) b = int(input()) m = int(input()) print(pow(a, b)) print(pow(a, b, m))
All done in two lines!
Here's my oneline code:
a = int(input()) b = int(input()) m = int(input()) print(pow(a,b)) print(pow(a,b,m))
print(_pow := pow(int(input()), int(input())), _pow % int(input()), sep="\n")