Data combination

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}

  

Guess you like

Origin www.cnblogs.com/chen-jun552/p/11491996.html