for

>>> list1 = ['a', 'b', 'c', 'd']
>>> list2 = ['apple', 'boy', 'cat', 'dog']
>>> for x, y in zip(list1, list2):
      print(x, 'is', y)

输出

a is apple
b is boy
c is cat
d is dog

你可能感兴趣的:(for)