↩ back to the box
Click to Play Course Video
( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Jsb2cuZmlueHRlci5jb20vcHl0aG9uLXNvcnRlZC1mdW5jdGlvbi8_dGxfaW5ib3VuZD0xXHUwMDI2dGxfdGFyZ2V0X2FsbD0xXHUwMDI2dGxfZm9ybV90eXBlPTFcdTAwMjZ0bF9wZXJpb2RfdHlwZT0zXHUwMDI2X19zPWg3ZzE2bGo4amI0aHB5NWRqNzNnIn0 )
Hey Finxter

This email series will teach you the most important of the most
essential Python built-in functions.

In today's lesson, you're going to learn about the sorted()
function to tap into Python's VERY efficient sorting algorithm.

Table of Contents* format()
* input()
* len()
* map()
* max(), min()
* print()
* range()
* sorted()
* sum()
* zip()
_______

You can read today's lesson in the full tutorial by Finxter
Creator Carrie-Anne here:
https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Jsb2cuZmlueHRlci5jb20vcHl0aG9uLXNvcnRlZC1mdW5jdGlvbi8_X19zPWg3ZzE2bGo4amI0aHB5NWRqNzNnIn0
( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Jsb2cuZmlueHRlci5jb20vcHl0aG9uLXNvcnRlZC1mdW5jdGlvbi8_dGxfaW5ib3VuZD0xXHUwMDI2dGxfdGFyZ2V0X2FsbD0xXHUwMDI2dGxfZm9ybV90eXBlPTFcdTAwMjZ0bF9wZXJpb2RfdHlwZT0zXHUwMDI2X19zPWg3ZzE2bGo4amI0aHB5NWRqNzNnIn0 )


If you work in a data-driven career, odds are you will at some
point have to perform sorting on your data.

Rather than writing your own sorting algorithm (which will most
likely be far less efficient), Python provides a built-in
function called sorted().

This function allows you to do basic sorting, such as arranging
in ascending or alphabetical order, but also has the ability for
a custom sort, in which you can sort according to your own
specifications.

For example:

>>> x = [4, 1, 2]
>>> sorted(x)
[1, 2, 4]

The sorted() function also allows for an optional key argument
that allows you to customize the default sorting behavior.

>>> marks = [[1, 4, 5], [2, 1, 2], [2, 3, 5]]
>>> sorted(marks, key = sum)
[[2, 1, 2], [1, 4, 5], [2, 3, 5]]

This example orders the nested lists
( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Jsb2cuZmlueHRlci5jb20vcHl0aG9uLWxpc3Qtb2YtbGlzdHMvP3RsX2luYm91bmQ9MVx1MDAyNnRsX3RhcmdldF9hbGw9MVx1MDAyNnRsX2Zvcm1fdHlwZT0xXHUwMDI2dGxfcGVyaW9kX3R5cGU9M1x1MDAyNl9fcz1oN2cxNmxqOGpiNGhweTVkajczZyJ9 )
by the sum of each list, smallest to largest, instead of the
default to order by elements.

If you want to learn more exciting features of the sorted()
function, read today's lesson in the full blog tutorial here:
https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Jsb2cuZmlueHRlci5jb20vcHl0aG9uLXNvcnRlZC1mdW5jdGlvbi8_X19zPWg3ZzE2bGo4amI0aHB5NWRqNzNnIn0
( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Jsb2cuZmlueHRlci5jb20vcHl0aG9uLXNvcnRlZC1mdW5jdGlvbi8_dGxfaW5ib3VuZD0xXHUwMDI2dGxfdGFyZ2V0X2FsbD0xXHUwMDI2dGxfZm9ybV90eXBlPTFcdTAwMjZ0bF9wZXJpb2RfdHlwZT0zXHUwMDI2X19zPWg3ZzE2bGo4amI0aHB5NWRqNzNnIn0 )


Tomorrow, you'll learn about the sum() function.

Towards continuous improvement in Python! πŸ§˜β€β™€οΈ
Chris

How are we doing? ( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Zvcm1zLmdsZS9pZnN5azlZa1o0azVBOWZqNz9fX3M9aDdnMTZsajhqYjRocHk1ZGo3M2cifQ )
⭐ ( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Zvcm1zLmdsZS9qUDE3aml4QmhFNEJ6NlZxOD9fX3M9aDdnMTZsajhqYjRocHk1ZGo3M2cifQ )
⭐⭐ ( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Zvcm1zLmdsZS9qUDE3aml4QmhFNEJ6NlZxOD9fX3M9aDdnMTZsajhqYjRocHk1ZGo3M2cifQ )
⭐⭐⭐ ( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Zvcm1zLmdsZS9qUDE3aml4QmhFNEJ6NlZxOD9fX3M9aDdnMTZsajhqYjRocHk1ZGo3M2cifQ )

To make sure you keep getting these emails, please
add chris@finxter.com to your address book or whitelist us.

I'd love to hear your feedback so that I can improve this free
email course over time. Please reply to this email and share
everything that's on your mind!

If you find the Finxter Email Academy useful, please invite a
friend or colleague! ❀
Here's the subscription link you can share:
https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Jsb2cuZmlueHRlci5jb20vc3Vic2NyaWJlLz9fX3M9aDdnMTZsajhqYjRocHk1ZGo3M2cifQ

Download the Ultimate Python Cheat Sheet here (direct PDF
download): 🐍
The Ultimate Python Cheat Sheet
( https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL2Jsb2cuZmlueHRlci5jb20vd3AtY29udGVudC91cGxvYWRzLzIwMjAvMDcvRmlueHRlcl9Xb3JsZHNNb3N0RGVuc2VQeXRob25DaGVhdFNoZWV0LnBkZj9fX3M9aDdnMTZsajhqYjRocHk1ZGo3M2cifQ )


Want out of the loop? https://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMzg3MzQxNiIsImRlbGl2ZXJ5X2lkIjoieXJjZ2Q3YTc1YmphdmVqNDk0bjIiLCJ1cmwiOiJodHRwczovL3d3dy5nZXRkcmlwLmNvbS9zdWJzY3JpYmVycy9oN2cxNmxqOGpiNGhweTVkajczZy9zdWJzY3JpcHRpb25zP2Q9eXJjZ2Q3YTc1YmphdmVqNDk0bjJcdTAwMjZleGNsdWRlX2NsaWNrPTFcdTAwMjZpbnRlbnQ9dW5zdWJzY3JpYmVcdTAwMjZfX3M9aDdnMTZsajhqYjRocHk1ZGo3M2cifQ. I'm so sad to see you go. 😒
How could we have done better? To help future Finxters, please
hit reply and tell us! πŸ€—

Not very motivated to learn today? Consider this:
"Knowledge compounds!" -- Warren Buffett

Consequently, if you improve your skills by 1% every day, you'd
36x your programming skills within a year!

Schurwaldstrasse 61, 70186 Stuttgart

Warning: the message above can be a phishing scam. See: legal notes