字典生成式
推导了字典生成的过程
dic = {i: i ** 2 for i in range(10)}
print(dic)
res = zip('abcd', [1, 2, 3, 4], [5, 6, 7, 8])
print(res)
dic1 = dict()
# for i,j in res:
# dic1[i]=j
# print(dic1)
print({k: v for k, v, i in res})
推导了字典生成的过程
dic = {i: i ** 2 for i in range(10)}
print(dic)
res = zip('abcd', [1, 2, 3, 4], [5, 6, 7, 8])
print(res)
dic1 = dict()
# for i,j in res:
# dic1[i]=j
# print(dic1)
print({k: v for k, v, i in res})