I have implemented a lambda function to sort a list. now i want to remove all the negative objects from the list by using lambda functions .
dto_list.sort(key=lambda x: x.count, reverse=True)
any one know a way to write the lambda expression to do it? I could not find a proper tutorial
Not very pythonic but here is how to do it with a lambda
Most people would use a list comprehension