- 1

module operator explain how 2 is output of this question

print(10//4)

16th Jan 2022, 1:32 PM
newton techi
2 Answers
+ 3
It's floor division operator(//) not modulo(%). It returns the quotient of a division. 10//4 = (2*4+2)//4 = 2 20//6 = (3*6+2)//6 = 3 ...
16th Jan 2022, 1:42 PM
Simba
Simba - avatar
0
4 * 2 = 8 so 10 // 4 = 2 (floor division) 10-8=2 is the reminder 10%4=2 (modulo opearation) also floating division.. 10/4=2.5
16th Jan 2022, 1:40 PM
Jayakrishna 🇼🇳