Python zip and unpack

zip

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

pythonzip.jpg

unpacking

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

pythonzip1.jpg

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

Follow this link for more Python content: Python

 

Advertisements