I want to have a variable number of variables with the variables equal to an array of numbers. I know similar questions have been asked but none provided the answer I was seeking.I have tried having the variables top and bottom either tuples or numpy arrays but neither worked. I don't care what the type of numbers are because I can convert them later, I just need the variable names changed with each iteration.
i=[0]
for x in i:
top= (1,1,1)
bottom= (1,1)
top[i]=top
bottom[i]=bottom
i.append(x+1)
Thanks for the help.
EDIT: Here is an example that probably better explains what I'm trying to do.
for x in range(1,4):
top = (1,1,1)
bottom = (1,1)
if x == 1:
top1 = top
bottom1 = bottom
if x == 2:
top2 = top
bottom2 = bottom
if x == 3:
top3 = top
bottom3 = bottom
In the bottom code I'm creating a new variable with each iteration, but I'm only doing it for a set amount of iterations. How can I do it for an infinite amount of iterations?