Is there a way to step between 0 and 1 by 0.1?
I thought I could do it like the following, but it failed:
for i in range(0, 1, 0.1): print i
Python's range() can only do integers, not floating point. In your specific case, you can use a list comprehension instead:
[x * 0.1 for x in range(0, 10)]
(Replace the call to range with that expression.)
For the more general case, you may want to write a custom function or generator.