I am currently writing a small bit of logic for my HTML page. My aim is to create variables (lists) within an iteration (using the iteration to create the names of said lists as the amount of them will be unknown to the program). I am currently creating the lists like this:
currentMap = elements.process
for i in elements:
currentMap = i.process
print("No change found, keeping heading the same.")
for i in maps:
for x in elements:
The syntax of your
print('mapsEle0') you need to do
Unfortunately your description of what you want and your code are a bit conflicting, so if you can, please try to explain some more what this code is supposed to do.
for i in maps.iterkeys(): for x in elements: if(x.process!=currentMap): currentMap=x.process elif(x.process==currentMap): maps[i].append(x)
This will iterate over all keys of
'mapsEle0'...'mapsEleN') and add
x to the contained list if the
elif condition is fulfilled.