I'm trying to figure out the best way to take the following 3 lists:
name_list = ["potatoes", "milk", "butter"]
quant_list = [500, 200, 40]
unit_list = ["g", "ml", "g"]
and convert them to a list of dictionaries, in the following format:
target_list = [{"name": "potatoes", "quant_units": {"amount": 500, "unit": "g"}}, {"name": "milk", "quant_units": {"amount": 200, "unit": "ml"}}, {"name": "butter", "quant_units": {"amount": 40, "unit": "g"}}]
I'm really struggling to figure out the methods, loops required to do this.
Any pointers would be much appreciated!