複数のイテラブルをまとめてタプルのイテレーターを返します。
構文
zip(*iterables)使用例
下記の値を入力するとサンプルに即時反映されます。
names→scores→for→name→score→zip→print→Alice→Bob→Carol→names = ["Alice", "Bob", "Carol"]
scores = [90, 85, 92]
for name, score in zip(names, scores):
print(f"{name}: {score}")
# Alice: 90
# Bob: 85
# Carol: 92