The variables have already been declared in advance.
They are to be used for various functions such as append()
.
The idea:
I want to use several variables (var1, var2, ..., var90
) in a for loop.
So that I do not have to call each variable individually, I want to solve the whole simplified.
The problem:
What is my approach to this?
My current attempt was with exec
, but I hardly know anything about it.
Here is my updated code:
for el in range(1, 91):
exec(f'var{el} = []')
exec(f'var{el}.append("Some Value")')