diff --git a/advanced-iterators.html b/advanced-iterators.html index 1dac3bf..9574652 100755 --- a/advanced-iterators.html +++ b/advanced-iterators.html @@ -390,7 +390,7 @@ Wesley [(0, 10), (1, 11), (2, 12), (None, 13)]
  1. The itertools.chain() function takes two iterators and returns an iterator that contains all the items from the first iterator, followed by all the items from the second iterator. (Actually, it can take any number of iterators, and it chains them all in the order they were passed to the function.) -
  2. The zip() function does something prosaic that turns out to be extremely useful: it any number of sequences and returns an iterator with the first items of each sequence, then the second items of each, then the third, and so on. +
  3. The zip() function does something prosaic that turns out to be extremely useful: it takes any number of sequences and returns an iterator with the first items of each sequence, then the second items of each, then the third, and so on.
  4. The zip() function stops at the end of the shortest sequence. range(10, 14) has 4 items (10, 11, 12, and 13), but range(0, 3) only has 3, so the zip() function returns an iterator of 3 items.
  5. On the other hand, the itertools.zip_longest() function stops at the end of the longest sequence, inserting None values for items past the end of the shorter sequences.