In addition to cheeken's answer, you can put the following at the top of your modules:
from __future__ import division
Doing so will make the division operator work the way you want it to i.e always perform a (close approximation of) true mathematical division. The default behaviour of the division operator (where it performs truncating integer division if the arguments happen to be bound to integers) was inherited from C, but it was eventually realised that it was not a great fit for a dynamically typed language like Python. In Python 3, this no longer happens.
In my Python 2 modules, I almost always import division from __future__, so that I can't get caught out by accidentally passing integers to a division operation I don't expect to truncate.
It's worth noting that from __future__ import ... statements have to be the very first thing in your module (I think you can have comments and a docstring before it, nothing else). It's not really a normal import statement, even though it looks like one; it actually changes the way the Python interpreter reads your code, so it can't wait until runtime to be exectuted like a normal import statement. Also remember that import __future__ does not have any of the magic effects of from __future__ import ....
5/365, by itself, into the interpreter and see what the result is.5/365into Python and see what it says. As the saying goes, teach a fish to debug...1/2and you get0, it should make you think. With a little more luck, you'll deduce that you callsqrt(0)and thus divide by zero. Now you have a much better question, "why is 1/2 equal to 0?", and then you'll already hit one of the many SO questions to that end in the "possible duplicate" suggestions while you type the question... something along those lines.