Post
Python
How can I sort a list of objects based on the attribute of that object?
Posted on 20th April 2024
Try this
ut.sort(key=lambda y: y.count, reverse=True)
newlist = sorted(ut, key=lambda y: y.count, reverse=True)
STILL GOT QUERIES?