Can someone pls explain this to me pls | Sololearn: Learn to code for FREE!
+ 1

Can someone pls explain this to me pls

>>> 20 // 6 3 >>> 1.25 % 0.5 0.25

29th Dec 2018, 2:40 AM
singhatehbangally
singhatehbangally - avatar
2 Answers
+ 4
Quotient and remainder of division for example 19 = 3 x 5 + 4 So 19//5 is 3 19%5 is 4
29th Dec 2018, 2:44 AM
Gordon
Gordon - avatar
+ 1
For your example 20//6 gives 3 '3' nothing but the quotient . 20 = 6 × 3 + 2 And 1.25 % 0.5 gives 0.25 2 × 0.5 = 1 so the remainder is 1.25 - 1 = 0.25 hope it helps
29th Dec 2018, 6:25 AM
Anupam Kumar
Anupam Kumar - avatar