Skip to content

Tag Archives: Python-sort

Sorting has always been quite popular utility with lots of applications everywhere, where Python language has opted. Python in its language offers a sort function… Read More
Sorting means rearranging a given sequence of elements according to a comparison operator on the elements. The comparison operator is used to decide the new… Read More
Given a list of tuples, write a Python program to sort the tuples alphabetically by the first item of each tuple. Examples: Input: [("Amana", 28),… Read More
Given, a list of tuple, the task is to sort the list of tuples based on the sum of elements in the tuple. Examples: Input:… Read More
Sometimes, while working with Python, we can have a problem in which we need to sort a particular list which has mixed data types. That… Read More
Sometimes, while working with Python, we can have a problem in which we need to perform the sort operation in all the Strings that are… Read More
Sometimes, while working with Python list, we can have a problem in which we need to perform sorting only of alternatively in list. This kind… Read More
Sometimes, while working with data, we can have a problem of sorting them. There are many types of basis on which sorting can be performed.… Read More
In this article, we will learn how to sort a Numpy array. There are multiple ways in Numpy to sort an array, based on the… Read More
Sometimes, while working with list of tuples, we can have a problem in which we need to perform it’s sorting. Naive sorting is easier, but… Read More
Sometimes, while working with Python tuples, we can have a problem in which we need to sort the tuples which constitutes of lists and we… Read More
Sometimes, while participating in a competitive programming test, we can be encountered with a problem in which we require to sort a pair in opposite… Read More
Sometimes, while working with Python list, we can come across a problem in which we need to sort list according to any tuple element. These… Read More
Given two strings (of lowercase letters), a pattern and a string. The task is to sort string according to the order defined by pattern and… Read More
While working with Python, one might come to a problem in which one needs to perform a sort on dictionary list value length. This can… Read More