I am trying to create and assign 10 variables, only differenciated by their index, all as empty lists within a for loop.
The ideal output would be to have agent_1 = [], agent_2 = [], agent_n = []
I know I could write this all out but thought I should be able to create a simple loop. The main issue is assigning the empty list over each iteration
for i in range(1,10):
agent_ + i = []
agent_1agent_2it’s a sign you should be using a list instead and usingagent[1]etc.agent = []before the loop and thenagent[i] = []inside, and then access to elements usingagent[n][m].