Python List

Flattening Nested Lists in Python

Python lists can be nested in the form of 2d structures as a replacement for arrays in other languages. Since python doesn’t have an array data type, it uses lists to create these 2d, 3d or sometimes N-dimensional arrays. Flattening refers to the process of reducing 2d arrays into 1 dimensional list. It collects all …

Flattening Nested Lists in Python Read More »

Squaring List Elements in Python

A list is one of the data types in Python, just like a tuple, set, or dictionary. These datatypes – List, Tuple, set or dictionary- are used to store data collections. Lists are used to store multiple elements, which can be stored in one single variable. In this article, we will look at how squaring list elements …

Squaring List Elements in Python Read More »