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
|
284 Discussions
|
Please Login in order to post a comment
import math
if name =='main': a = int(input()) b = int(input()) m = int(input())
a = int(input()) b = int(input()) m = int(input()) print(pow(a,b)) print(pow(a,b,m))
Hello,
This was a tricky one because if you use the
math
moduel forpow
it will only accept 2 parameters which are a and b. The python built inpow
accepts 3 parameters. Hope this helps someone!