class Foo():
	def __init__(self, key, value):
		self.key = key
		self.value = value

def main():
	foo = [Foo(2, 1), Foo(1, 2), Foo(5, 3)]
	range1 = [ x for x in foo if x.key == 1 ]
	print("value for key 1 is", range1[0].value)

main()