[Tutor] index elongated/decreased

Thomas Rivas trivas7@rawbw.com
Fri, 9 Aug 2002 21:19:07 -0700


Hi progressing  pythonistas--

Playing with the interpreter I came up with this:

>>> a = [66.6, 333, 333, 1, 1234.5]
>>> print a.count(333), a.count(66.6), a.count('y')
2 1 0
>>> a.insert(2, -1)
>>> a.append(333)
>>> a
[66.599999999999994, 333, -1, 333, 1, 1234.5, 333]

Can anyone explain why 0th index came out as it did? Is this a floating point 
arithmetic issue/limitation? Thanks.

Tom Rivas