number_side1_list=[]
number_side2_list=[]
number_side3_list=[]
number_side4_list=[]
for i in range(1,19):
w="number_side1_"+str(i)
w1="number_side2_"+str(i)
w2="number_side3_"+str(i)
w3="number_side4_"+str(i)
number_side1_list.append(w)
number_side2_list.append(w1)
number_side3_list.append(w2)
number_side4_list.append(w3)
print("")
print(number_side1_list)
print("")
print(number_side2_list)
print("")
print(number_side3_list)
print("")
print(number_side4_list)
So my code makes a list 18 strings but I would like to make them into variables. I want to be able to use them for a different part of my program as an array.
My desired out is as follows:
((number_side1_1 ,number_side1_2 ,number_side1_3 ....)
Edit: So I am making a monopoly game and I need to make 2 buttons for every tile. So there will be 18. Each button will increase in by 1 when I click it. So I need a way to store 4 variables. The x,y of where it is positioned and the number, and the surface to which it needs to blink to. I'm still really new to programming so I'd appreciate some advice as to how I might do that. I made a a lot of tiny rectangles for the button which are now clickable. The i devided the x and y coordinates by 2 of each rectangle for the position. Next I was going to store them in an array like this (x,y,n,surface) for each square. I already have the x and y for each rectangle I just needed the n and surface. I'll look into dictionaries and see how they work.