I would like to access to attribute of objects in a dictionary in order to find the object with the maximum value on this argument. For example i have this:
class MyClass:
def __init__(self,name,value):
self.name=name
self.value=value
Dict=dict()
object_1 = MyClass("object_1",1)
Dict[object_1.name]=object_1
object_2 = MyClass("object_2",5)
Dict[object_2.name]=object_2
and i would like to do something like:
max(dict.value)
But i can't figure how to acces the attribute of all the object. Can you help me please?