My question is about Python variables. I have a bunch of variables such as p1, p2 and p3. If I wanted to make a loop that let me change all of them at once, how would I do that? Here is what I got so far.
p1 = 0
p2 = 0
p3 = 0
p4 = 0
p5 = 0
p6 = 0
p7 = 0
p8 = 0
p9 = 0
p10 = 0
x = 10
while(x < 0):
p+str(x) = p+str(x) + 1
x - 1
This code should change 10 variables called p1, p2, p3 (ect) by 1 each.
p, instead of individual variables, and store your values such thatp2 == p[2]. Then just iterate over that list.