0
Floor division will return value as integer ?
As shown 20//6 gives 3 or 3.0
5 Respostas
0
It will return 3 but 20/6 will return 3.0.have a nice day;-)
0
20//6 =3 it is feature of python 3.0
in python 2.7 it was not there
0
20//6 is integer division, it will only return the integer part of that answer (the amount of times 6 can go into 20).
20/6 will return you the actual answer which would be 3.33333...
a//b integer division (floor division)
a/b floating point division
0
floor division gives the greatest integer less than or equal to the answer of 20/3, if code is print(20//6) you get output 3
but if the code is print(-20//6) you get the output as -4
it does not just truncate the value of the float( the one you get by just dividing) , it is clear in the case of negative numbers
- 1
it will return 3.0