I have the following code:
x=4200/820
It should return x=5.12
but it gives x=5
. How can I change this. Thanks
EDIT: If instead I had this code:
x=(z-min(z_levels))/(max(z_levels)-min(z_levels))
Where z, min(z_levels) and max(z_levels)
are values that change in a for loop taken from a list.
How can I make x
a float? Do I need to change the code like this:?
x=float(z-min(z_levels))/float(max(z_levels)-min(z_levels))