欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

数据组合

程序员文章站 2022-04-14 23:20:29
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 = [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}