> >> The right way is to do it like this: > >> > >> >>> x = 0.0 > >> >>> for i in range(1, 11): > >> ... x = i*0.1
> > But this I don't understand. > > Why would you use a loop when the final value is just > > What you missed was the original context, where other work was being > done in the loop, and where the accuracy of the "accumulator" was being > misunderstood. Ah yes, I confess I didn't read the OPs code in detail, I was more interested in Steven's reply. If other things are happening in the loop then that explains things. Thanks Dave. Alan G. _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
