Tag Archives: Python List

Replace Item in Python List

There are many ways to replace item or items from a Python list. We can use indexing, list comprehension, for loop, and map() function, to change single or multiple values from a Python list. There can be many scenarios where you want to replace single or multiple elements from a Python list. In that, you must know all… Read More »

A Guide to Flatten List & List of Lists in Python

Python List is one of the widely used Python data containers. The list can store multiple data objects. It can store any type of Python data object including itself. A list containing a list is known as a multi-dimensional list, it could be 2D, 3d, or multi-d. Often in Python interviews, the developer asks to flatten a Python… Read More »

Difference Between Python List append() and extend() Methods

In Python, we have the List data structure that is used to store multiple values in a single variable. The Python list is an alternative data structure to the array data structure supported by various other programming languages. Python list supports two similar functions, namely append() and extend() that you can use to insert new data values in… Read More »

Tuple vs List in Python

Python is the most popular programming language of 2022. It comes with many powerful built-in data structures and data types. Python data structures allow their developers to store and organize data in different formats. This article goes into tuple vs list. Lists and tuples are the two most commonly used data structures in Python. Both data structures are… Read More »

How to Remove Duplicates from a Python List

Python list is a very flexible and widely used Python data structure. Python does not support static Arrays like other high-level programming languages, instead, it has List which is an alternative for Python array. A Python list can contain multiple data values, and to access an individual value we can use the value corresponding index number. In this… Read More »