Python 3.4 - Zip

The zip function takes two lists and puts them together. It will create positions for the items in the list:

List = ['matt', 'tom', 'taylor']
List2 = ['han', 'leia', 'luke']

names = zip(List, List2)

for a, b in names:
    print(a, b)


https://www.youtube.com/watch?v=cTXHmOt7Rwc

Comments

Popular posts from this blog

Python 3.4 - Caesar Cipher

UML - Use Case Diagram