Python zip and unpack

zip

Zip is a quick way to take multiple lists can combine them.

unpacking

To reverse the effect, turn a list of tuples into separate lists, use * in the parenthesis: zip(*x)

Try your code in our online Python console:  

If you enjoyed this lesson, click LIKE below, or even better, leave me a COMMENT. 

Last Lesson: lambda, map, reduce, filter

Next Lesson: list comprehension

Back to Python Course: Course

 

One thought on “Python zip and unpack

  1. Pingback: Python: lambda, map(), reduce(), filter() – Analytics4All

Leave a Reply