0
我有一個基本列表排序使用的基本列表
li = ['fca', 'fc_add', 'fca_2', 'fcadd_2', 'Red_Exis', 'G_Exis', 'P_Exis', 'fam_1']
,並希望使用列表中的項目的索引位置排序如下字典
其中列表項的索引位置的字典項是鍵。
dic = {'G_Exis': 'abc', 'fca': '210Y', 'Red_Exis': 107, 'fc_add': '999 Des ST.'}
我需要最終排序的字典如下所示:
fin_dic = {'fca': '210Y', 'fc_add': '999 Des ST.', 'Red_Exis': 107, 'G_Exis': 'abc'}
多謝提前。