I have a variable having same name as a string. Using the string, how can the access the value stored in the variable of the same name?
I wanted to do the following thing:
A1=10
A2=20
var1='A1'
var2='A1+A2'
print(var1) #I want output to be 10
print(var2) #I want output to be 30
print(var1) gives 'A1'
print(var2) gives 'A1+A2'