you can also put at the very top from __future__ import division.
This uses the python 3 division, which is float when required and integer when necessary. By that I mean that you will get

4/2 = 2
3/2 = 1.5 

Instead of 3/2 = 1 like in python 2. This gives you the right division everytime, thus you don't need to put 3./2 or cast float on integers. And it also makes you code python 3 compatible in a way, since the behavior of your code will change when used on the interpreter, while using the import ensure the behavior will be the same ;)