Python zip() Function

Python zip() Function

The zip() function makes an iterator that aggregates elements from each of the iterables and returns an iterator of tuples.

Syntax

Parameter

iterables: Iterator objects that will be joined together

Return

This function returns an iterator of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables.

Example 1

Output

Example 2

Output