Nov-26-2020, 09:50 AM
Since Python 3 the
Depending on the datatype the result could be an
//
is the integer division. It returns a number without remainder.Depending on the datatype the result could be an
int
or float
.In [1]: 5 // 2 Out[1]: 2 In [2]: 5 // 2.0 Out[2]: 2.0 In [3]: 5.0 // 2 Out[3]: 2.0 In [4]: 5.0 / 2 Out[4]: 2.5 In [5]: 5 / 2.0 Out[5]: 2.5 In [6]: 5 / 2 Out[6]: 2.5 In [7]: 2 // 1 Out[7]: 2
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!