efficiencyIsBliss efficiencyIsBliss - 1 month ago 8
Python Question

How do get more control over loop increments in Python?

I'm trying to loop from 0 to 1 using step sizes of 0.01 (for example). How would I go about doing this? The

for i in range(start, stop, step)
only takes integer arguments so floats won't work.

Answer
for i in [float(j) / 100 for j in range(0, 100, 1)]:
    print i
Comments