数据组合
程序员文章站
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}
上一篇: .NetCore从零开始使用Skywalking分布式链路追踪系统
下一篇: 模拟退火算法