【发布时间】:2019-09-17 08:56:29
【问题描述】:
我想从三个二维列表创建一个字典。例如:
list1 = [['Brand', 'Release Date', 'Related'], ['Structure', 'Screen', 'Photos', 'Videos']]
list2 = [['Brand', 'Aliases'], ['Release date', 'State'], ['Predecessor', 'Successors'], ['Size', 'Aspect Ratio', 'Weight', 'Usable surface', 'Materials', 'Colors', 'Origami']]
list3 = [['OppoSmartphones by Oppo', 'PAFM00, Oppo Find X Standard Edition'], ['June 2018, 10 months ago', 'On Sale'], ['Oppo Find 7', 'Oppo Reno'], ['74.2 mm x 156.7 mm x 9.4 mm', '19:9', '186 g', '87 %', 'Glass', 'Turquoise Violet', 'Print 3D Model']]
我想要的结果是
{'Brand':{'Brand': 'OppoSmartphones by Oppo', 'Aliases': 'PAFM00, Oppo Find X Standard Edition'}, 'Release Date':{ 'Release date': 'June 2018, 10 months ago', 'State': 'On Sale'}, 'Related':{'Predecessor': 'Oppo Find 7', 'Successors': 'Oppo Reno'}}
【问题讨论】:
-
是什么阻止你这样做?
-
输出中的
['Structure', 'Screen', 'Photos', 'Videos']发生了什么? -
什么都没发生。我只是不想显示结果太长。
标签: python list dictionary