import from the __future__


Python 2.7 still struggles with divisions of integers, which means that 1/2 returns 0 instead of 0.5. To avoid that, just use:

from __future__ import division