r/PythonLearning • • 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

9 comments sorted by

View all comments

1

u/TheKnottyOne Nov 01 '26 edited Nov 01 '26

4 - pow() takes the parameters of: base, power, mod. So it’ll do 2 to the power of 5 then % 7

2

u/Buttleston Nov 01 '26

Been programming in python for like 15 years, and I had no idea

1

u/atreidesardaukar Nov 01 '26

I didn't do the math, but here's the documentation for the built-in function: 

https://docs.python.org/3/builtins/functions.html#pow