In this course, you’ve learned how to use Python’s zip() function. zip() can receive multiple iterables as input. It returns an iterator that can generate tuples with paired elements from each argument. The resulting iterator can be quite useful when you need to process multiple iterables in a single loop and perform some actions on their items at the same time.
Now you can:
- Use the
zip()function in both Python 3 and Python 2 - Loop over multiple iterables and perform different actions on their items in parallel
- Create and update dictionaries on the fly by zipping two input iterables together
You’ve also coded a few examples that you can use as a starting point for implementing your own solutions using Python’s zip() function. Feel free to modify these examples as you explore zip() in depth!
Liam Pulsifer RP Team on June 3, 2020
Thanks for watching, @DanielHao5! Glad you enjoyed the course and the examples. The REPL I use in these tutorials is PtPython, which is available through Pip.