I wanted to code a program thats makes variables with loops like this:
for k in range(5):
exec(f'test_{k} = k')
But the problem is that I want to do the same thing but reading the values from the variables:
for k in range(5):
print('test_'+ k )
I know that it is not gonna work because:
- it is int to str (it is giving this error)
- it is not gonna print the value of the variable (because he dosent know that it is a variable)
Can someone help me?