Function to return percentages in Python
In Python 3.0 or later, you do not need to explicitly convert your numbers to float. This is because the / operator always does floating point division (the // operator does "floor" division). 

For older versions of Python (2.2 or later), you can use:

from __future__ import division


which changes the old meaning of / to the above. This makes the operation of / more predictable as the result no longer depends on the type of the inputs.