I get as input a list with three items
[{item1},{item2},{item3}]
But each item takes the form (including the curley brackets):
{'key1': 'val1', 'key2': val2, 'key3': val3}
so when I print my list it looks like this (again the curley brackets are not set by me but are just delivered as you see it by input via API response):
[{'key1': 'val1', 'key2': val2, 'key3': val3}, {'key4': 'val4', 'key5': val5, 'key6': val6}, {'key7': 'val7', 'key8': val8, 'key9':val9}]
I want to have a dict where every comma separated key-val pair within each item is an element. hence:
{'key1': 'val1', key2': val2, 'key3': val3, 'key4': 'val4', 'key5': val5, 'key6': val6, 'key7': 'val7', 'key8': val8, 'key9':val9}
I tried first to make a new list which only contains "item1", hence newlist contains [{'key1': 'val1', 'key2': val2, 'key3': val3}]
the length of this new list is said to be 3 items and I thought: perfect! Now I can access key1-val1 pair by newlist[0]
and feed a dict with {newlist[0],newlist[1],newlist[2]} to get {'key1': 'val1', 'key2': val2, 'key3': val3}
, but this does not work.
Any suggestion? I guess the curley brackets are the problem? I mean I found various answers googleing "list to dict conversion" but none of what I saw had that...