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
Explanation: The first zip consumes one element (the number 4) from the iterator before realizing it has no matching element from the second list. The element was not "peeked", but taken and it can't be pushed back to a python iterator.
Note: This examples "works" with the reverse order of arguments in the zip.
The text was updated successfully, but these errors were encountered:
Real life lesson. It boggles the mind of many people I show to. Please tell me if this is good enough to add to the wtfpython.
Let's zip some numbers and characters.
Somehow the number 4 is lost in the process.
Explanation: The first
zip
consumes one element (the number 4) from the iterator before realizing it has no matching element from the second list. The element was not "peeked", but taken and it can't be pushed back to a python iterator.Note: This examples "works" with the reverse order of arguments in the zip.
The text was updated successfully, but these errors were encountered: