Python Create a List

  • Post category:List

In this blog post, you will learn how to create a list in Python. A list is a collection of items in a particular order.

You can make a list that includes the letters of the alphabet, the digits from 0-9, or the names of all the people in your family.

In Python, square brackets [] indicate a list and individual elements in the list are separated by commas.

Step 1: Create a list

my_list = [1, 2, 3, 4, 5]

Step 2: Print the list

print(my_list)

Output:

[1, 2, 3, 4, 5]