So I have something like this:
for j, key in zip(range(10), SomeNestedDictionary.keys()):
dictionary1 = SomeNestedDictionary[key]
However here dictionary1
, is always the same name. Instead I would like a way to have dictionary_someNameDependentOnTheIndexOfTheLoop
, so that I will create 10 dictionaries with different names. How do I do this? How do I control the name of the dictionary?
Also, is there a way of doing something similar,but with a list? I.e. changing the name of the list to be created at each iteration of a loop?
Notice this questions is different from the one marked as duplicate. In that questions simple lists could have solved the problem, here they cannot.