I am relatively new to Python, and I'm wondering how I can call a variable in the name of a new variable.
For example, when I have the 2 following variables and their values:
number1 = 100
string1 = 'abc'
and I want to write a line of code such that I can create new variables who's name contains the values of variables number1 and string1 (e.g new_var_100 and new_var_abc)
For example:
new_var_(value_of_number1) = 200 ##What to write on LHS?
new_var_(value_of_string1) = 'def' ##What to write on LHS?
such that when I call new_var_100, it returns 200; and when I call new_var_abc, it returns 'def'.
Thanks very much.