Python用列表和zip生成字典 有时需要用列表生成字典,用列表和zip可以满足此需求,试看如下例子 >>> ls = ['a','b','c'] >>> lt = [1,2,3] >>> d = dict(zip(ls,lt)) >>> d {'a': 1, 'b': 2, 'c': 3}