# Category Archives: Python Programs

## Python | Add similar value multiple times in list

Adding a single value in list is quite generic and easy. But to add that value more than one time, generally, a loop is used… Read More »

## Python | Get first element with maximum value in list of tuples

In Python, we can bind structural information in form of tuples and then can retrieve the same. But sometimes we require the information of tuple… Read More »

## Python | Interleave multiple lists of same length

Given lists of same length, write a Python program to store alternative elements of given lists in a new list. Let’s discuss certain ways in… Read More »

## Python program to find middle of a linked list using one traversal

Given a singly linked list, find middle of the linked list. Given a singly linked list, find middle of the linked list. For example, if… Read More »

## Python Program to print digit pattern

The program must accept an integer N as the input. The program must print the desired pattern as shown in the example input/ output. Examples:… Read More »

## Python | Merge two lists into list of tuples

Given two lists, write a Python program to merge the two lists into list of tuples. Examples: Input : list1 = [1, 2, 3] list2… Read More »

## Python | Combining two sorted lists

Many a times we encounter a problem where we wish to use the merge function of merge sort and is a classical problem that occurs… Read More »

## Python | List consisting of all the alternate elements

Some of the list operations are quite general and having shorthands without needing to formulate a multiline code is always required. Wanting to construct the… Read More »

## Python | Finding strings with given substring in list

The classical problem that can be handled quite easily by Python and has been also dealt with many times is finding if a string is… Read More »

## Python program to print Emojis

There are multiple ways we can print the Emojis in Python. Let’s see how to print Emojis with Uniocdes, CLDR names and emoji module. Using… Read More »

## Python | Convert set into a list

Given a set, write a Python program to convert the given set into list. Examples: Input : {1, 2, 3, 4} Output : [1, 2,… Read More »

## Python program to print the substrings that are prefix of the given string

Given a string, print all the possible substrings which are also the prefix of the given string. Examples: Input : ababc Output : a, ab,… Read More »

## Second largest value in a Python Dictionary

In this problem we will find the second largest value in the given Dictionary. Examples: Input : {‘one’:5, ‘two’:1, ‘three’:6, ‘four’:10} Output : Second largest… Read More »

## Iterate over characters of a string in Python

In Python, while operating with String, one can do multiple operations on it. Let’s see how to iterate over characters of a string in Python.… Read More »

## Python | Convert a list into a tuple

Given a list, write a Python program to convert the given list into a tuple. Examples: Input : [1, 2, 3, 4] Output : (1,… Read More »