When I first started coding in Python, lists were the very first data structure I used. I realized how powerful they are. A Python list can hold numbers, strings, or even a mix of both. It’s like having a flexible container where you can store and organize your data.
Over the years, I’ve used lists in almost every project, from analyzing sales data for one of my clients to building automation scripts for reporting.
In this tutorial, I’ll show you several practical ways to create a list in Python. I’ll also explain the theory behind lists, so you’ll know exactly when and how to use them.
List in Python
A list in Python is an ordered collection of items.
Think of it as a shopping list. You can add items, remove them, or rearrange them. Python lists work the same way.
Some key points about lists:
- Lists are ordered (the items keep their position).
- Lists are mutable (you can change them after creation).
- Lists can hold different data types (integers, strings, floats, even other lists).
Here’s a quick example:
# A simple Python list
shopping_list = ["Apples", "Bananas", "Oranges", "Milk"]
print(shopping_list)Output:
['Apples', 'Bananas', 'Oranges', 'Milk']Method 1 – Create a List Using Square Brackets
The most common way to create a list in Python is by using square brackets [].
I use this method almost every day because it’s quick and easy.
# Creating a list of numbers
numbers = [10, 20, 30, 40, 50]
print(numbers)
# Creating a list of strings
cities = ["New York", "Chicago", "Los Angeles", "Houston"]
print(cities)
# Mixed list
mixed = [25, "Python", 3.14, True]
print(mixed)I executed the above example code and added the screenshot below.

This is the simplest way to start working with lists.
Method 2 – Create a List Using the list() Constructor
Sometimes, I need to convert another data type into a Python list. That’s when the list() constructor comes in handy.
# Creating a list from a string
word = "Python"
letters = list(word)
print(letters) # ['P', 'y', 't', 'h', 'o', 'n']
# Creating a list from a tuple
tuple_data = (100, 200, 300)
list_from_tuple = list(tuple_data)
print(list_from_tuple)
# Creating a list from a range
numbers = list(range(1, 6))
print(numbers) # [1, 2, 3, 4, 5]I executed the above example code and added the screenshot below.

This method is especially useful when handling data conversions.
Method 3 – Create a List Using List Comprehension
List comprehensions are one of my favorite features in Python.
They allow you to create lists in a single line of code.
# Creating a list of squares
squares = [x**2 for x in range(1, 11)]
print(squares)
# Filtering even numbers
evens = [x for x in range(1, 21) if x % 2 == 0]
print(evens)
# Converting text to uppercase
words = ["python", "guides", "usa", "coding"]
upper_words = [w.upper() for w in words]
print(upper_words)I executed the above example code and added the screenshot below.

I often use this method when I need to transform or filter data quickly.
Method 4 – Create an Empty List
Sometimes, I just want to start with an empty list in Python and add items later.
There are two ways to do this:
# Empty list using []
empty1 = []
print(empty1)
# Empty list using list()
empty2 = list()
print(empty2)
# Adding elements later
empty1.append("Data")
empty1.append("Analysis")
print(empty1)This approach is great when you don’t know the data in advance.
Method 5 – Nested Lists
A Python list can also contain another list. I’ve used nested lists when working with tabular data, like sales figures across different U.S. states.
# Nested list example
sales_data = [
["California", 1200, 1500, 1700],
["Texas", 1000, 1100, 1300],
["Florida", 900, 950, 980]
]
print(sales_data)
# Accessing nested elements
print(sales_data[0][0]) # California
print(sales_data[1][2]) # 1100This structure feels like working with rows and columns, similar to a spreadsheet.
Method 6 – Use Multiplication for Repeated Lists
If I need a Python list with repeated values, I use multiplication.
# Repeating the same element
zeros = [0] * 5
print(zeros) # [0, 0, 0, 0, 0]
# Repeating a string
greetings = ["Hello"] * 3
print(greetings) # ['Hello', 'Hello', 'Hello']This is a quick way to initialize lists with default values.
Method 7 – Use User Input
In real-world projects, lists often come from user input.
Here’s a simple example:
# Creating a list from user input
data = input("Enter numbers separated by spaces: ")
numbers = data.split()
numbers = [int(x) for x in numbers]
print(numbers)If I enter:
10 20 30 40 50The program outputs:
[10, 20, 30, 40, 50]This is useful for interactive programs or quick scripts.
Best Practices for Creating Lists
After years of working with Python, here are some tips I always follow:
- Use comprehensions for clarity – They make your code shorter and easier to read.
- Avoid unnecessary conversions – Only use list() when needed.
- Start with empty lists when data is unknown – It keeps your code flexible.
- Be careful with nested lists – They can get complicated quickly.
- Use descriptive names – Instead of list1, use students, sales, or cities.
Real-World Example – Analyze Sales Data
Let me share a simple example from a project I worked on for a U.S. retail client.
We had monthly sales data for different stores, and I needed to calculate the total sales.
# Sales data for different stores
sales = [
["New York", 12000, 15000, 17000],
["Chicago", 10000, 11000, 13000],
["Los Angeles", 9000, 9500, 9800]
]
# Calculate total sales for each store
for store in sales:
city = store[0]
total = sum(store[1:])
print(f"{city} total sales: ${total}")Output:
New York total sales: $44000
Chicago total sales: $34000
Los Angeles total sales: $28300This is a practical way lists can help in real business scenarios.
In this tutorial, I showed you different ways to create lists, from simple square brackets to comprehensions and nested lists.
I also shared a real-world example so you can see how lists are used in practice. Once you get comfortable with lists, you’ll find yourself using them in almost every Python project.
If you’re just starting, practice with small examples first. Then, move on to real-world data like sales reports, student grades, or even website logs.
You may read other list articles:
- How to Find the Size of a Python List
- Fix IndexError: List Out of Range Error in Python
- Remove the First Element From a List in Python
- Uppercase the First Letter in a Python List

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.