** * This article is from Udemy "[Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style](https://www.udemy.com/course/python-beginner/" Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style ")" It is a class notebook for myself after taking the course of. It is open to the public with permission from the instructor Jun Sakai. ** **
for
days = ['Mon', 'Tue', 'Wed']
fruits = ['apple', 'banana', 'orange']
drinks = ['coffee', 'tea', 'bear']
for i in range(len(days)):
print(days[i], fruits[i], drinks[i])
result
Mon apple coffee
Tue banana tea
Wed orange bear
zip
days = ['Mon', 'Tue', 'Wed']
fruits = ['apple', 'banana', 'orange']
drinks = ['coffee', 'tea', 'bear']
for day, fruit, drink in zip(days, fruits, drinks):
print(day, fruit, drink)
result
Mon apple coffee
Tue banana tea
Wed orange bear
Recommended Posts