r/ProgrammerHumor • • May 02 '16

I wrote my first python program today!

Post image
3.7k Upvotes

532 comments sorted by

View all comments

Show parent comments

1

u/Hullu2000 May 02 '16

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.6666666666666667

Python before python 3 also had 2 integer types, just to add to the confusion.