Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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)


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: