I have a list like this
[[{1:"one",2:"two"},{1:"one"}],[{3:"three",4:"four"},{3:"three"}]]
required output:
[{1:"one",2:"two"},{1:"one"},{3:"three",4:"four"},{3:"three"}]
Can someone please tell me how to proceed?
Iterate over the list's lists to add that to another list.
list_1 = [[{1:"one",2:"two"},{1:"one"}],[{3:"three",4:"four"},{3:"three"}]]
list_2 = []
for list in list_1:
for dictionary in list:
list_2.append(dictionary)
print(list_2) # [{1: 'one', 2: 'two'}, {1: 'one'}, {3: 'three', 4: 'four'}, {3: 'three'}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With