Sep-28-2018, 09:50 PM
I have been advised that the answer to my own query is:
Nested list in a dictionary should do the trick. You could also use a matrix.
For example
lookup = {2:[50,100,150],4:[100,150,200],6:[150,200,250],8:[200,250,300]}
So if you want to get Parameter B value 2 of parameter A=6 then you can do
print(lookup[6][1])
This looks up the dictionary 'lookup' for key 6 which contains [150,200,250]. Then it returns index 1 (the second value) of that list =200.
Nested list in a dictionary should do the trick. You could also use a matrix.
For example
lookup = {2:[50,100,150],4:[100,150,200],6:[150,200,250],8:[200,250,300]}
So if you want to get Parameter B value 2 of parameter A=6 then you can do
print(lookup[6][1])
This looks up the dictionary 'lookup' for key 6 which contains [150,200,250]. Then it returns index 1 (the second value) of that list =200.