+ 1
% operator
What is the result of this code? >>> 7%(5 // 2) I do not understand how the answer came "1".
3 odpowiedzi
+ 4
The part in the bracket will be calculated first. So 5//2 will do a floor division and give 2.
Now apply the modulo operator.
7%(5//2) = 7%(2) = 1
0
Thank You gays