I want to increment a variable in a loop to get x1, x2, x3, etc.
your text
loop = 0
your text
While loop < 4
your text
xn = something, something else, something else again..
your text
n += 1
your text
loop += 1
At the end, I want to have x1, x2, x3 all equal to different things
This is not working. This appears to be a combination of incrementing **AND ** concatenation of a variable at the same time. Any hints?
I’ve tried:
globalizing xn, x1, x2, x3
concatenating strings and converting to integer, xn = int(str(x) + str(n)).
concat(x, n)
xnew = x + n
Nothing seems to be working. At the end, x1, x2 and x3 are all zero