I've been working on Python for last few months and I encountered this problem. So, I have a dictionary which contains only keys and no values.
{'_id' : None, 'game' : None, 'viewers' : None ....}
And I want to add data which are in the list. For example,
[123456, 'StarCraft 2', 300, ....]
As you might guess, the order of elements inside the list corresponds to the order of keys inside the dict. I think using for loop is the solution but I couldn't come up with a good one.
Extra question: The dict above is now dictionaries inside a list. And, I want to add exactly same dictionary with same keys and new values every time I get a new list of data.
[{'_id': 001, 'game':'StarCraft 2', 'viewers':300, ...},
{'_id': 002, 'game':'Tetiris', 'viewers': 30, ...},
... ]
How do I do that?
Thanks, Python friends!!