What does the zip() function do when iterables of different lengths are passed?

Python Developer Medium

Python Developer — Medium

What does the zip() function do when iterables of different lengths are passed?

Key points

  • Zip() function stops at the shortest iterable length
  • Discards extra elements from longer iterables
  • Resulting zipped object matches the length of the shortest iterable

Ready to go further?

Related questions