I am newbie, apologies if I used wrong terminology
I have a ton of variables (named with strings and integers) in my code and want to make a simple loop to call all the variables easily.
Example:
acc1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
acc2 = ["John", "Doe", "Example", "code"]
c = [1, 2]
for i in c:
something = 'acc'+str(i)
# convert string to list
print(something[0])
I'd like to concatenate letters in acc1 and acc2 in a loop. So that I can work on a certain variable in the loop.
I am not sure if what I did is correct. I created strings to form the variable name, which is not working out.
Any help is appreciated
Thanks