# Category Archives: Python Programs

## Python | Finding relative order of elements in list

Sometimes we have an unsorted list an we wish to find the actual position the elements could be when they would be sorted, i.e we… Read More »

## Python | Split tuple into groups of n

Given a tuple, the task is to divide it into smaller groups of n. Let’s discuss a few methods to accomplish a given task. Method… Read More »

## Python | Joining unicode list elements

Sometimes we can receive data in different formats other than the conventional list or strings or integers or characters. Python has many other data types… Read More »

## Python | Sort given list of dictionaries by date

Given a list of dictionary, the task is to sort the dictionary by date. Let’s see a few methods to solve the task. Method #1:… Read More »

## Python | Check if element exists in list of lists

Given a list of lists, the task is to determine whether the given element exists in any sublist or not. Given below are a few… Read More »

## Python | Count unique sublists within list

Given a list of lists, the task is to find the count of unique sublists within list. Examples: Input: [[‘Geek’, ‘for’, ‘geeks’], [‘geeks’, ‘for’], [‘for’,… Read More »

## Python | Find fibonacci series upto n using lambda

The Fibonacci numbers are the numbers in the following integer sequence. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..… Read More »

## Python | Count the sublists containing given element in a list

Given a list of lists, write a Python program to count the number of sublists containing the given element x. Examples: Input : lst =… Read More »

## Python | Sort list elements by frequency

Given a list containing repeated and non-repeated elements, the task is to sort the given list on basis of the frequency of elements. Let’s discuss… Read More »

## Python | Sort list of lists by the size of sublists

Given a list of lists, the task is to sort a list on the basis of size of sublists. Let’s discuss a few methods to… Read More »

## Python | Subgroups of i’th index size in list

Sometimes we need to group elements and grouping techniques and requirements vary accordingly. One such way to group the elements is by the i’th size… Read More »

## Python | Check whether a string is valid json or not

Given a string, the task is to check whether a string is valid json object or not. Let’s try to understand the problem using different… Read More »

## Python | Append at front and remove from rear

Being familiar with the concept of queue, which follows FIFO rule, i.e first in first out, that suggests a front removal and rear insertion. This… Read More »

## Python | Convert list of tuples into digits

Given a list of tuples, the task is to convert it into list of all digits which exists in elements of list. Let’s discuss certain… Read More »

## Python | First Non-Empty String in list

Sometimes while dealing with data science, we need to handle a large amount of data and hence we may require shorthands to perform certain tasks.… Read More »