Hi all,

tes = [{'a': 1, 'b': 'this', 'c': 221},
       {'a': 2, 'b': 'this', 'c': 215},
       {'a': 1, 'b': 'is', 'c': 875},
       {'a': 1, 'b': 'sentence', 'c': 874},
       {'a': 2, 'b': 'another', 'c': 754},
       {'a': 2, 'b': 'word', 'c': 745}]

The above one is  the result form the DB. I am trying to convert it to
something like

result_tes = [{'a': 1, 'b': 'this, is, sentence', 'c': '221, 875, 874'},
              {'a': 2, 'b': 'this, another, word', 'c': '215, 754, 744'}]

if the value of the 'a' is same, then all those other values of the dict
should be merged/clubbed.

I tried, but it became complex and complex.

please can any one help me to get the result.


Thanks,
Sunil. G
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to