Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

1.0 KB
Raw Blame

title: Python zip() built-in function - Python Cheatsheet description: Iterate over several iterables in parallel, producing tuples with an item from each one.

Python zip() built-in function From the Python 3 documentation Iterate over several iterables in parallel, producing tuples with an item from each one.

Examples

>>> furniture = ['table', 'chair', 'rack', 'shelf']
>>> price = [100, 50, 80, 40]
>>>
>>> for item, amount in zip(furniture, price):
...     print(f'The {item} costs ${amount}')
# The table costs $100
# The chair costs $50
# The rack costs $80
# The shelf costs $40