
Why is 2/1 == 1.0 in Python3? - mkesper
I was astonished by this result:
Python 3.8.5 (default, Aug  2 2020, 15:09:07) 
[GCC 10.2.0] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; 2&#x2F;1
2.0<p>Why is that?
======
Someone
Are you sure about the “1.0” in the title? The descriptive text you wrote says
you got “2.0”.

1.0 would surprise me, 2.0 is because, as others said, “/” was changed to do
‘normal’ division, with “//” a new operator for integer division (flooring the
result)

------
gregjor
Documented behavior:
[https://docs.python.org/3.3/reference/expressions.html#binar...](https://docs.python.org/3.3/reference/expressions.html#binary-
arithmetic-operations)

Dates to PEP 238 from 2001:
[https://www.python.org/dev/peps/pep-0238/](https://www.python.org/dev/peps/pep-0238/)

------
rzzzwilson
On my MacBook Pro, using python 3.8.5 I get

    
    
        >>> 2/1
        2.0

~~~
asplake
Also (since Python 2.2):

    
    
      >>> 2//1
      2

