0

need to add new key/value pair in existing dictionary.

I beleive there should be the way of doing it with declarative style something like

     new_data = [x['new_key']=1 for x in simplejson.loads(data)]

(gives syntax error)

how to do something similar ?

EDIT: I need not to merge, but edit existed dict or create or duplicate

Ilja
  • 1,205
  • 1
  • 16
  • 33

0 Answers0