I have a list of class objects:
list = [x, y, z]
But I want to sort them like integers (they have an integer variable defined in them that I want to sort by (I access it by doing list[x].score)), but I don't know how to.
How can I sort this? (the list has a variable length)
Ideally, something like this:
list = [x, y, z] # x.score = 2, y.score = 3, z.score = 1
list.sort() # Or something
# list = [z, x, y]