How do I find an object in a sequence satisfying a particular criterion?
List comprehension and filter go through the entire list. Is the only alternative a handmade
Too lazy to write:
mylist = [10, 2, 20, 5, 50] max(mylist, key=lambda x: x>10)