I have two variables as follows:
a = "1"
b = "21"
and a list:
['a', 'b', '3', '4', '5', '64']
How would I go about replacing variable names with their values in the list, like:
['1', '21', '3', '4', '5', '64']
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m guessing you don’t mean the fact you just need to give the name of the variable, not as a string?
You could do a “monstrosity” such as:
But if you’re in a situation that you’re doing that, or thinking of doing that — it’s time to think again