I'm trying to give a number to a function where that number will be used to determine which variables will be used. I think it would look something like this:
num1 = 61
nun2 = 48
num3 = 27
char1 = "a"
char2 = "b"
char3 = "c"
color1 = "red"
color2 = "blue"
color3 = "green"
def func (inputnumber):
# don't know what to put in here
return [num,char,color]
I have a set of variables numbers 1,2, and 3. For my function, I will give an input of 1,2, or 3 (I guess it has to be str(inputnumber)
)and the function will take that number and determine which variables to use to process data.
For example, if I input 1, I would like to get a list of [61, "a","red].
Is there a way to do this? I do know about dictionaries but I don't want to make or store new variables and would like to use the ones that already exist.