Skip to content

Tag Archives: python-tuple

In this article, we will discuss multiple ways by which we can create a list of tuples in Python. Method 1: Using list() and tuple()… Read More
Python Tuples is an immutable collection of that are more like lists. Python Provides a couple of methods to work with tuples. In this article,… Read More
Lists: are just like dynamic sized arrays, declared in other languages (vector in C++ and ArrayList in Java). Lists need not be homogeneous always which… Read More
If you have used Python even for a few days now, you probably know about unpacking tuples. Well for starter, you can unpack tuples or… Read More
Shuffling numbers can sometimes prove to be a great help while programming practices. This process can be directly implemented on the data structures which are… Read More
List: A list is of an ordered collection data type that is mutable which means it can be easily modified and we can change its… Read More
List: Lists are just like dynamic sized arrays, declared in other languages (vector in C++ and ArrayList in Java). Lists need not be homogeneous always… 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
Given, a list of tuples, the task is to multiply the elements of the tuple and return list of the multiplied elements. Examples: Input: [(2,… Read More
This is a quite simple problem but can have a good amount of application due to certain constraints of python language. Because tuples are immutable,… Read More
Predict the output of these two expressions on Python console On console Geek = (1, 2, [8, 9]) Geek[2] += [3, 4] Output: Explanation: Look… Read More
The normal sorting of tuples has been dealt previously. This article aims at sorting the given list of tuples by the second element, based on… Read More
The interconversion between datatypes is quite useful utility and many articles have been written to perform the same. This article discusses the interconversion between a… Read More
Given a list of tuples, the task is to group the tuples by matching the second element in the tuples. We can achieve this using… Read More
Given a list of tuples, the task is to find all those tuples containing the given element, say n.Examples:   Input: n = 11, list =… Read More