
Oct. 3, 2021
3:21 a.m.
Then use it with the normal expression lambda: people.sort(key=p => (p.salary, p.name, p.id)). You don’t need lambda set for that. If you want to use it, it will be like the following: people.sort(key=p => {(p.salary, p.name, p.id)}). The tuple expression is the last item of the set, so the tuple is the return value. Abdulla Sent from my iPhone
On 3 Oct 2021, at 2:25 AM, Chris Angelico <rosuav@gmail.com> wrote:
people.sort(key=lambda p: (p.salary, p.name, p.id))