Zip

The zip function returns an iterator of tuples based on the iterators provided. It has any many elements as the length of the shortest iterator.

number_list = [1, 2, 3]
str_list = ['one', 'two', 'three', 'four']
result = zip(number_list, str_list)
print(result) # [(1, 'one'), (2, 'two'), (3, 'three')]

Unzipping

coordinate = ['x', 'y', 'z']
value = [3, 4, 5]

result = zip(coordinate, value)
result_list = list(result)
print(result_list)

c, v =  zip(*result_list) # c = ('x', 'y', 'z') v = (3, 4, 5)