+ 1
>>>20//6
what is this can u please teach me
6 Answers
+ 9
It's division(floor) operator. It rounds off the value to the nearest whole number.
20//6 = 3.333...
Now 3.333... rounds off to 3, so 3 is the answer.
+ 1
// = ONLY gives you NUMBER OF TIMES and ignores remainder.
Example: print(20//6) = 3
22//4 = 5
31//7 = 4
31//8 = 3
+ 1
@ steller fox..
// operator doesnt round of to nearest integer value...
it gives just the int value..
if it did rounded of..then
23//6 would be 4(cause..3.83 is closer to 4)
but it gives 3 anyway..
✌✌✌✌
+ 1
but where did the reminder of 1.25 came from instead of 2
0
a//b=int(a/b)...
0
@Mubanga Peter, 1.25 % .5 = .25 is remainder not quotient.
1.25 / .5 = 2, here 2 is quotient.