0
pow() function
What does the third argumeny of pow() function do? And is that function is somehow related to math.pow() ??
2 ответов
+ 5
As you can see by using:
help(pow)
the third argument is the modulo:
pow(x, y, z) == x**y % z
So, pow(4, 5, 6) equals 4**5 % 6, so 1024 % 6, which is 4 (1024/6=170R4).
AFAIR, math.pow only accepts the first two arguments. Plus, it always returns a float, even if the arguments are int.
0
M Tamim
thanks again.