Skip to content

Instantly share code, notes, and snippets.

@iximiuz
Created May 19, 2016 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iximiuz/65b11a434a15a960abd1c1e98895b95b to your computer and use it in GitHub Desktop.
Save iximiuz/65b11a434a15a960abd1c1e98895b95b to your computer and use it in GitHub Desktop.
Python 2 vs Python 3 division operator
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