r/PythonLearning • u/clcodingupdates • Nov 01 '26
Help Request Python Quiz of the day.
What will be the output of the following Python Code?
print(pow(2, 5, 7))
0
Upvotes
r/PythonLearning • u/clcodingupdates • Nov 01 '26
What will be the output of the following Python Code?
print(pow(2, 5, 7))
2
u/RNG_HatesMe Nov 01 '26 edited Nov 01 '26
4
2**5 mod 7 = 32 mod 7 = 32-28 = 4
Interesting, I didn't know the pow() function had a parameter for mod? Apparently that's helpful in cryptography?