How to append a list of dictionaries value to another list. This my first dict:
d=[{'title': 'a', 'num_iid': 36167009077, 'seller_id': 249772349},{'title': 'b', 'num_iid': 1234, 'seller_id': 249772349},{'title': 'c', 'num_iid': 12784, 'seller_id': 12475}]
and the list that I want to append it:
d1=[{'title': 'a', 'image_url': 'a.jpg', 'subtitle': '140.00', 'buttons': [{'type': 'postback', 'title': 'Details', 'payload': '/'}, {'type': 'postback', 'title': 'shop', 'payload': '/'}]}, {'title': 'b', 'image_url': 'b.jpg', 'subtitle': '2193.00', 'buttons': [{'type': 'postback', 'title': 'Details', 'payload': '/'}, {'type': 'postback', 'title': 'shop', 'payload': '/'}]}, {'title': 'c', 'image_url': 'c.jpg', 'subtitle': '3203.00', 'buttons': [{'type': 'postback', 'title': 'Details', 'payload': '/'}, {'type': 'postback', 'title': 'shop', 'payload': '/'}]}]
What I need is insert the 'num_iid' and 'seller_id' in each buttons payload
Expected output:
result=[{'title': 'a', 'image_url': 'a.jpg', 'subtitle': '140.00', 'buttons': [{'type': 'postback', 'title': 'Details', 'payload': '36167009077'}, {'type': 'postback', 'title': 'shop ', 'payload': '249772349'}]}, {'title': 'b', 'image_url': 'b.jpg', 'subtitle': '2193.00', 'buttons': [{'type': 'postback', 'title': 'Details', 'payload': '1234'}, {'type': 'postback', 'title': 'shop', 'payload': '249772349'}]}, {'title': 'c', 'image_url': 'c.jpg', 'subtitle': '3203.00', 'buttons': [{'type': 'postback', 'title': 'Details', 'payload': '12784'}, {'type': 'postback', 'title': 'shop', 'payload': '12475'}]}]