Background
In Python, the zip function takes in one or more iterable objects (such as lists, tuples, or strings) and returns an iterator of tuples. Each tuple contains elements from each iterable object in the same position. The zip function stops when it reaches the end of the shortest iterable object.
Here is an example of how the zip function works: