If I had the following code:
random_variable = "Hello World"
new_value = "It Works!"
And I had something like this:
def set_variable_value(var_name, new_value):
// Code here
pass
Is it possible to have a function like the one above where var_name
is a string? It should take var_name
and find a variable named the value of the string, and change the value to whatever new_value is.
I'm sorry if this is a dumb question, I searched the web for a while now and discovered nothing related to my issue. (Google is being useless as usual)
Thanks