Quotient & Remainder | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Quotient & Remainder

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

5th Feb 2019, 4:55 AM
SyQuesse Clyburn
2 Respostas
+ 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