User Tools

Site Tools


python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
python [2026/09/09 18:29] – carlpython [2026/09/09 19:44] (current) – carl
Line 80: Line 80:
       File "<stdin>", line 1, in <module>       File "<stdin>", line 1, in <module>
     TypeError: 'set' object doesn't support item deletion     TypeError: 'set' object doesn't support item deletion
 +
 +
 +''enumerate(iterable, start=0)''
 +
 +The ''start'' parameter doesn't do what I expect.   I would have expected it to start at the element listed, but instead it just adds start to the returned tuple index:
 +
 +    >>> for i, k in  enumerate([9, 8, 7], 1): print (i, k)
 +    ... 
 +    1 9
 +    2 8
 +    3 7
 +
 +I would have expected this to return 2 total elements instead:
 +
 +    ...
 +    1 8
 +    2 7
 + 
  
  
python.txt · Last modified: by carl