Python按关键字索引取dictionary.

AST = ['AGENDA'],["WOMEN'S STATUS", 'TREATIES',
'SIGNATURES, ACCESSIONS, RATIFICATIONS',
'RESERVATIONS AND DECLARATIONS',
'GENDER DISCRIMINATION'], ['ELECTION OF MEMBERS',
'BIOGRAPHY'], [ "WOMEN'S RIGHTS",
"WOMEN'S STATUS",
'PERIODIC REPORTS']"


最后采用
>>> {idx: sublist for idx, sublist in enumerate(AST, 1)}
{1: ['AGENDA'],
 2: ["WOMEN'S STATUS", 'TREATIES', 'SIGNATURES, ACCESSIONS, RATIFICATIONS', 'RESERVATIONS AND DECLARATIONS', 'GENDER DISCRIMINATION'],
 3: ['ELECTION OF MEMBERS', 'BIOGRAPHY'],
 4: ["WOMEN'S RIGHTS", "WOMEN'S STATUS", 'PERIODIC REPORTS']}
上一篇:【python实例】判断是否为酒后驾车


下一篇:Thomas-SCW混合共识助力Thomas屏幕经济新发展