You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use the enumerate method to adapt an iterator to produce a value and that value’s index in the iterator, placed into a tuple. The first call to enumerate produces the tuple (0, 'a'). When this value is matched to the pattern (index, value), index will be 0 and value will be 'a', printing the first line of the output.
It appears it should not say "The first call to enumerate", but rather "The first call to next", referring to the for loop implicitly calling next on the iterator, as there is only the one call to enumerate, and it produces not a tuple but a new iterator.
The text was updated successfully, but these errors were encountered:
Zoybean
added a commit
to Zoybean/book
that referenced
this issue
Jun 18, 2019
In Chapter 18.1, the section on
for
Loops says:It appears it should not say "The first call to
enumerate
", but rather "The first call tonext
", referring to the for loop implicitly callingnext
on the iterator, as there is only the one call toenumerate
, and it produces not a tuple but a new iterator.The text was updated successfully, but these errors were encountered: