Posted on 9th September 2024|27 views
How can I sort a list of objects based on the attribute of that object?
Posted on 9th September 2024| views
Try this
ut.sort(key=lambda y: y.count, reverse=True)
newlist = sorted(ut, key=lambda y: y.count, reverse=True)