Variable function calling

lets suppose I have a variable in a script module such as
app.testModule

value1 = 1 value2 = 2 value3 = 3
In a script I am changing these values like
app.testModule.value1 = 2

but I’d like to reference the number variably, something like:

number = 2 app.testModule(number) = 4

Any suggestions?

Store the variables in a list

#List
varList = [1,2,3]
number = 2
print varList[number-1]
varList[number-1] = 4
print varList[number-1]

or as a dictionary

myDict = {1:1,2:2,3:3}
number = 2
print myDict[number]
myDict[number] = 4
print myDict[number]

thanks Kyle