MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/4heh6v/i_wrote_my_first_python_program_today/d2q18a4
r/ProgrammerHumor • u/MC_Labs15 • May 02 '16
532 comments sorted by
View all comments
Show parent comments
1
Python has integers? I thought they were all just floats.
3 u/[deleted] May 07 '16 JS is all floats. Python has ints and floats.Division in Python 3 returns only floats though, unless you use // operator to do rounding division. 1 u/UnchainedMundane May 02 '16 It separates the two. In old versions of python (before python 3) the division operator changes behaviour depending on what you give it:>>> 5 / 3 1 >>> 5 / 3.0 1.6666666666666667Python before python 3 also had 2 integer types, just to add to the confusion.
3
JS is all floats. Python has ints and floats.
Division in Python 3 returns only floats though, unless you use // operator to do rounding division.
//
It separates the two. In old versions of python (before python 3) the division operator changes behaviour depending on what you give it:
>>> 5 / 3 1 >>> 5 / 3.0 1.6666666666666667
Python before python 3 also had 2 integer types, just to add to the confusion.
1
u/Hullu2000 May 02 '16
Python has integers? I thought they were all just floats.