+ 1
I dont get how 20//6 = 3. Please help me
4 Respuestas
+ 15
Normal output would be : 3.333333.... if you used "/" but you did a floor division ("//") which means that the 0.3333333 will be dropped.... (everything after decimal point . )
+ 4
well use this it works on me and print 3 not 3.333333....
print(20//6)
+ 2
// is floor division. It represents how many times the second number occurs in the first number. So, in the example we can see that 6 occurs 3 times in 20. It basically returns the greatest divisor, 3*6 is 18, but 4*6 is 24, which is over 20, so it returns 3, because it us the biggest number that when multiplied by 6 gives a number that's under 20.
0
Oh okay, than you all for your answers!