0
I didn't got the remainder thing
7% (5//2)
2 odpowiedzi
+ 2
By following the PEMDAS rule alternative to BODMAS in maths, Parenthesis comes first.
Double // produces exact integer not float and not to the nearest whole number( as in rounding a number) eg. 5//2 = 2 not 2.5 or 3
Also the remainder of modulo % division is it's answer, hence
7 % (5 // 2) = 7 % 2 ( parenthesis 1st and applying double // rule above )
Also, 7 divided by 2 = 3 remainder 1
and by applying modulo rule the remainder is the answer, hence 7 % 2 = 1
Therefore:
7 % (5 // 2) = 7 % 2
= 1
0
that was very clear thanks