You can sort any iterable with the sorted() function, but you can sort an array in-place with the sort method. I also discuss how to sort by multiple values, the Schwartzian Transform, and how to properly sort strings.
Join me on Discord: / discord
Support me by buying from Amazon through my affiliate link: https://amzn.to/2FBNVwA
Here's my Patreon account if you want to give me money: / realphysics
Other ways to support Real Physics: • How to Support Real Physics
Playlist: • Theory of Python
Thank you!