I am trying to improve my existing code, is there any way to affect multiples different variables without using dict or lists or tuples??
I am trying to write something like:
number1 = 1
number2 = 2
number3 = 3
for i in (1,2,3):
number{i} += 1
and then have number1 = 2 number2 = 3 and number3 = 4
i was thinking about formatting string but it doesn’t work, thx for reading.
A better approach here would be to use dictionary :
otherwise you can also you
globals():