Created
May 19, 2016 11:27
-
-
Save iximiuz/65b11a434a15a960abd1c1e98895b95b to your computer and use it in GitHub Desktop.
Python 2 vs Python 3 division operator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Input | Py2 | Py3 | |
----------+-----+----- | |
5/2 | 2 | 2.5 | |
----------+-----+----- | |
5//2 | 2 | 2 | |
----------+-----+----- | |
5.0/2 | 2.5 | 2.5 | |
----------+-----+----- | |
5.0//2 | 2.0 | 2.0 | |
----------+-----+----- | |
5/2.0 | 2.5 | 2.5 | |
----------+-----+----- | |
5//2.0 | 2.0 | 2.0 | |
----------+-----+----- | |
5.0/2.0 | 2.5 | 2.5 | |
----------+-----+----- | |
5.0//2.0 | 2.0 | 2.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment