AI engineering glossary · Python core
What is zip?
zip: A built-in function that combines several iterables element by element, yielding tuples of matching positions and stopping at the shortest input. It is used to loop over parallel lists or build dictionaries from keys and values.
zip: an example
list(zip([1, 2, 3], ['a', 'b'])) gives [(1, 'a'), (2, 'b')], and dict(zip(keys, values)) builds a dictionary.
Related terms
More Python core terms
Where you learn it
zip is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.