In my project I have user made variables. What I'm trying to do is print the variable if the user gives a string named the same as the variable. Here's what I think it would look like:
variable = 123
userInput = input("Enter a variable to print: ")
print(userInput)
# Instead of printing userInput, it will check if userInput is the name of a variable,
# and print if it is.
The user will input "variable", and will print 123
.
Also note that the variables will have their custom names and data. So if the variable name is something different, user entering "variable" won't cause it to be printed.
And yes, I know that having user-made variables can be a bad idea. I know what I'm doing.