python同时遍历两个list

python同时遍历两个list

list1 = ['a', 'b', 'c', 'd']
list2 = ['apple', 'boy', 'cat', 'dog']
for x, y in zip(list1, list2):
  print(x, y)
注:两个列表等长

 

 
 
posted @ 2020-04-18 08:19  上官幺樱花  阅读(610)  评论(0)    收藏  举报