Iterate Over Multiple Lists Simultaneously

Want to learn more? I recommend these Python books: Python for Data Analysis, Python Data Science Handbook, and Introduction to Machine Learning with Python.

Create Two Lists

names = ['James', 'Bob', 'Sarah', 'Marco', 'Nancy', 'Sally']
ages = [42, 13, 14, 25, 63, 23]

Iterate Over Both Lists At Once

for name, age in zip(names, ages):
     print(name, age)
James 42
Bob 13
Sarah 14
Marco 25
Nancy 63
Sally 23