Effective ways to sort Python iterables

Let’s sort

The traditional way to sort iterables is by using loops, like for loop or while loop. As part of this article, I’m not going to cover this traditional way, rather I’ll be focusing on a better way to implement sorting.

And that better way is by using sorted function.

Let’s take a look at below list holding some numbers:

numbers = [2,3,6,4,9,1]

--

--

--

I’m C# Corner MVP, mentor, speaker, YouTuber & developer. YouTube: https://www.youtube.com/channel/UCQVOeT4i5nezvPG_xvIFzdQ Blog: http://www.shwetalodha.in

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Should You Join A Coding Bootcamp? Ask Yourself These 6 Questions First

Enterprise Architecture Roles in Decision-making for Information Technology Capital Investments

Introduction to databases

Building Resilient Microservices — A Guide for TPMs

Playground driven development in Swift

The Only Constant in Modern Infrastructure is Change

The Art of Outreach

A guide to create (offline) multi-tenant apps with Expo and AWS Amplify

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shweta Lodha

Shweta Lodha

I’m C# Corner MVP, mentor, speaker, YouTuber & developer. YouTube: https://www.youtube.com/channel/UCQVOeT4i5nezvPG_xvIFzdQ Blog: http://www.shwetalodha.in

More from Medium

Install Python Package On Per User Basis

what is python ?

One Year of Python

Python Web Development Framework in 2022