How to Use Python Lambda With the Sort Method

Published: 22 August 2019
on channel: Real Python
25,726
597

You’ll see how to use a lambda for the key of the sort() method of lists. sort() has two parameters. key is None by default. reverse is False by default.

You won’t be altering reverse, but you will be looking at key because you can use a lambda expression to alter the behavior of sort(). When you use lambda, you can extend key to be much more versatile.

Click here to learn more: https://realpython.com/courses/python...


On this page of the site you can watch the video online How to Use Python Lambda With the Sort Method with a duration of hours minute second in good quality, which was uploaded by the user Real Python 22 August 2019, share the link with friends and acquaintances, this video has already been watched 25,726 times on youtube and it was liked by 597 viewers. Enjoy your viewing!