0

I am trying to make a dictionary that contains all the values in the three lists below

 name=["james","t","Lione"]
 group=["A","B","C"]
 station=["1","2","3"]

 myDict={}
 print(myDict)

I want to populate myDict with the values in the lists above. the output should look like this:

[{'name':'james','group':'A','station':'1'}, 
{'name':'t','group':'B','station':'2'}, 
{'name':'Lione','group':'C','station':'3'}]
MattDMo
  • 96,286
  • 20
  • 232
  • 224
  • `keys = ["name", "group", "station"]` followed by `[dict(zip(keys, tpl)) for tpl in zip(name, group, station)]` – Paul M. Mar 30 '22 at 15:49

0 Answers0