i have a list of strings
list1 = ["object1", "object2", "object3"]
and i want to convert it into a list of object
the main idea is to have a function that returns a list in ascending order based on the value of an attribute of all instances
class Players: # this is the class and score is the value
def __init__(self, username, score):
self.username = username
self.score = score
I need a function that as soon as it is called returns a dictionary sorted in ascending order by the "score" value that contains username : score
thank you so much