I am trying this in Python 2.7 Interpreter.
>>> print 1/10
0
>>> print float(1/10)
0.0
>>> print 1/5
0
>>> a = 1/5
>>> a
0
>>> float(a)
0.0
>>>
I want a value in floating point when I divide. Any idea on the logic behind this zero out put and please let me know how to do it correctly.
The float conversion is happening after the integer division. Try this: