efficiencyIsBliss efficiencyIsBliss - 1 year ago 94
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 Source
for i in [float(j) / 100 for j in range(0, 100, 1)]:
    print i
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download