数据组合

a = [1, 2, 3]
b = [4, 5, 6]
c = [7, 8, 9]

for x, y, z in (a, b, c):
    print(x, y, x)
    print(type(zip(a, b, c)))

# 打印出 1 2 3 , 4 5 6 , 7 8 9

print("-"*30)

a = ['A', 'B', 'C']
b = [1, 2, 3]

x = dict(zip(a, b))
print(x)
print(type(x))

#打印出 {'A': 1, 'B': 2, 'C': 3}

  

    原文作者:羊肉串552
    原文地址: https://www.cnblogs.com/chen-jun552/p/11491996.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞