Original Question
This is written in Python 2 using Jupyter Notebook. I apologize in advance if the phrasing/terms are unconventional. I am a beginner & unaware of most coding conventions.
blue = 24
red = 18
color = input('What color would you like to know the value for? \n')
print (color)
I would like to be able to run the code, input 'blue' and have it print 24.
EDIT:
Ideally, I would like to not have to build a dictionary. This is a simplification of my actual code. I already have many, many variables defined (some definitions requiring user input) and it would be very inconvenient to have to create a dictionary from which.
This is my (more realistic) code:
blue = input('What is the value of blue?')
green = input('What is the value of blue?')
cyan = blue*green
color = input('What color would you like to know the value for? \n')
print (color)
I would like to be able to run the code, input cyan and have it print the numerical value of the variable cyan.
example: run. input 3. input 5. input cyan. code prints 15