0

Quotient & Remainder

Print(7%(5//2)) Please explain how you get to your answer

5th Feb 2019, 4:55 AM
SyQuesse Clyburn
2 Respuestas
+ 1
5//2 = 2 (floor division) 7%2 = 1 (modulus division, 1 - remainder)
5th Feb 2019, 5:44 AM
Vladimir {Tomsk}
Vladimir  {Tomsk} - avatar
+ 1
// floor division operator does almost same than / divison operator, but the difference is that floor division always returns a whole number. % modulus operator performs a floor division, and what was left over by the floor division is the value of modulus.
5th Feb 2019, 7:04 AM
Seb TheS
Seb TheS - avatar