Home > other >  Consult a python output json
Consult a python output json

Time:03-09

There are two list of dictionary:
Lst_1=[{' ID ':' 001 ', 'Name' : 'Ian', 'ege' : '18'}, {" ID ": '001', 'Name' : 'Tom', 'ege' : '17'}, 'ID', '002', 'Name' : 'Jerry', 'ege' : '16', 'ID', '002', 'Name' : 'Conner', 'ege' : '10']

Lst_2=[{' ID ':' 001 ', 'Color' : 'red' and 'Sports' :' also '}, {" ID ": '001', 'Color' : 'Blue', 'Sports' :' football '}, {" ID" : '002', 'Color', 'yellow' and 'Sports' :' "tennis"}, {' ID ':' 002 ', 'Color', 'green' and 'Sports' :' swimming '}]

The output into the following kinds:
Dic_1={' ID ':' 001 ', 'Description' : [{' Name ':' Ian ', 'ege' : '18'}, {' Name ':' Tom ', 'ege' : '17'}], 'Hobby' : [{' Color ':' red 'and' Sports' : 'also'}, {' Color ':' Blue ', 'Sports' :' football '}]}

Dic_2={' ID ':' 002 ', 'Description' : [{' Name ':' Jerry ', 'ege' : '16'}, {' Name ':' Conner ', 'ege' : '10'}], 'Hobby' : [{' Color ':' yello ', 'Sports' :' "tennis"}, {' Color ':' green 'and' Sports' : 'swimming'}]}



  • Related