Zentrader wrote:
There is no need for a function or a generator.  A for() loop is a
unique case of a while loop
## for i in range(-10.5, 10.5, 0.1):
ctr = -10.5
while ctr < 10.5:
   print ctr
   ctr += 0.1

Python stores floats in binary, and 0.1 can't be held exactly as a
fractional binary number. Therefore it might be better to produce the
values as integers divided by 10:

for i in range(-105, 105):
    i = i / 10.0
    # do stuff here using i
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to