4 ms·
Similar in spirit to the Haskell and Lisp examples, here it is in Python: people = [Person('foo', 'bar'), Person('John', 'Doe'), Person('Jane', 'Anonymous'
by sgk284 15y ago
Similar in spirit to the Haskell and Lisp examples, here it is in Python:
people = [Person('foo', 'bar'), Person('John', 'Doe'), Person('Jane', 'Anonymous')]
key = lambda person: len(person.first_name + person.last_name)
max(people, key=key)