Hi All,
i have a dictionary like
res = [{'description': 'Testo',
'id': '676',
'parentOf': True},
{'description': 'Pesto',
'id': '620',
'parentOf': False}]
i looking for the result like this
res = [{'description': 'Testo',
'id': '676',
'id_desc':'676_Testo',
'parentOf': True},
{'description': 'Pesto',
'id': '620',
'id_desc':'620_Pesto',
'parentOf': False}]
to get this result
i wrote a code like this
for i in res:
dict = {}
dict['id_desc'] = str(i['id'])+','+str(i['description'])
i.update(dict)
is there any other simple methods to achieve this?
Thanks,
Sunil. G
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor