var_name = "my_variable" var_value = 42 # Try to create a variable named "my_variable" and assign it the value 42 exec(var_name + " = " + str(var_value)) # Now try to print the value of "my_variable" print(my_variable)