Python range function
Python2.x:
for idx in range(0, int(100 / 0.5)):
print 0.5 * idx
outputs:
0.0
0.5
1.0
1.5
..
99.0
99.5
Numpy:
numpy.arange
would also do the trick.
numpy.arange(0, 100, 0.5)
If you have numpy
, here are two ways to do it:
numpy.arange(0, 100, 0.5)
numpy.linspace(0, 100, 200, endpoint=False)