1some_variable = "here is a string stored in this variable"
2# Get the variable name from a string by the eval() function:
3# Notice how the parameter is a string but the print() function still returns the variable
4print(eval("some_variable"))
5
6# More advanced usage
7import random
8thing1 = "thing 1"
9thing2 = "thing 2"
10thing3 = "thing 3"
11
12number = random.randint(1, 3)
13variable_as_a_string = "thing" + str(number)
14
15print(eval(variable_as_a_string))