Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All of these things, including the int division "thing" are present in python 2.7 already. For division, you need to import it:

    from __future__ import division
And then dividing numbers works a bit more logical (well I think it's more logical). You can do division with rounding with the // operator: a // b, and it even works with floats: (3.9 // 1.2) == 3


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: