I am not even sure if this is possible as I am new to python. Essentially I want to construct a dict for lookup purposes - this is my first stab at a data structure.
lookup = {
1000000: {
"Name":"Neutral grassland",
"values":[6150166, 1000000, 1000283, 1000516, 1000524, 1000525, 1000526,
1300000, 1300016, 1300017, 1300522, 1300527, 1310000, 1320000]
}
}
I would like a method, a little like get() but where I can return the whole object of 100000 when a number is found within the values array.
Is this possible? Bonkers?
if my_value in lookup[1000000]["values"]: do_something()