If you’re a beginner learn programmer or new to Python, you might be wondering how to declare a list in Python. Lists are one of the most popular data structures in Python and are very versatile for storing data. In this article, we’ll show you how to make a list in Python, and go over some of the most common list operations.
How to Make a List in Python
Lists are a built-in data structure in Python that can store heterogeneous data. Lists are mutable, meaning they can be modified after they’re created.
To create a list in Python, you use square brackets  . For example:
>>> my_list = [1, 2, 3]
You can also use the list() constructor to create a list:
>>> my_list = list([1, 2, 3])
The list() constructor can be used to create lists from other data structures, like tuples or sets. We’ll talk more about tuples and sets later in this article.
Lists can contain any type of data, including integers, floats, strings, booleans, and even other lists. For example:
>>> my_list = [1, 2.5, "Hello", True, [1, 2, 3]]
Lists can also be empty. To create an empty list, you use empty square brackets  :
>>> my_list = 
You can also create lists with a single element:
>>> my_list = 
Lists are a very powerful data structure in Python, and you’ll use them often in your programs.
List Operations in Python
Python lists are powerful data structures that enable you to store and manipulate data in a variety of ways. In this article, we’ll explore some of the most common list operations in Python.
Adding Elements to a List
One of the most common operations you’ll need to perform on a list is adding new elements to it. This can be done in a number of ways:
Append: The append() method adds a new element to the end of a list.
Insert: The insert() method inserts a new element at a given index.
Extend: The extend() method adds a list of new elements to the end of an existing list.
Concatenate: The + operator can be used to concatenate two lists.
Accessing List Elements
To access individual elements in a list, you use square brackets  with the index of the element you want to access. The index starts at 0 for the first element, and goes up to the length of the list minus one. For example: