Last modified: Apr 22, 2026 By Alexander Williams

How to Define an Empty List in Python

Creating an empty list is a fundamental Python skill. You will use it often. It is the starting point for storing data.

An empty list has no elements. It is like a blank container. You can add items to it later.

This guide explains the two main methods. We will also cover best practices and common uses.

Method 1: Using Square Brackets []

The most common way is using square brackets. Just write a pair of brackets with nothing inside.

This method is clear and fast. It is the preferred style in the Python community.


# Define an empty list using square brackets
my_list = []

# Print the list and its type
print(my_list)
print(type(my_list))
    

[]
<class 'list'>
    

The output shows an empty list. The type() function confirms it is a list.

You can now use append() or other list operations to fill it. For a full guide, see our Python List Operations Guide for Beginners.

Method 2: Using the list() Constructor

The second method uses the built-in list() function. Call it with no arguments.

This creates a new, empty list object. It is useful when converting other data types.


# Define an empty list using the list() constructor
empty_list = list()

# Print the list
print(empty_list)

# Check if it's empty
print(len(empty_list) == 0)
    

[]
True
    

The len() function returns 0. This proves the list is empty.

Which Method Should You Use?

Both methods create a valid empty list. The choice depends on context.

Use square brackets [] for simplicity. It is more readable and slightly faster. It is the standard way.

Use the list() constructor for clarity in certain cases. It makes your intent explicit. This is helpful when teaching or converting data.


# Example: Converting a string to a list of characters
text = "hello"
char_list = list(text)  # Starts with the characters, not empty
print(char_list)

# Starting with an empty list for collection
results = []  # Clear intent to collect items later
    

['h', 'e', 'l', 'l', 'o']
    

Checking if a List is Empty

After creating a list, you often need to check its state. Use a simple boolean test.

In Python, an empty list is "falsy." You can use it directly in an if statement.


my_list = []

# Method 1: Direct boolean evaluation (Recommended)
if not my_list:
    print("The list is empty.")

# Method 2: Check length
if len(my_list) == 0:
    print("The list is empty.")

# Method 3: Compare to an empty list
if my_list == []:
    print("The list is empty.")
    

The list is empty.
The list is empty.
The list is empty.
    

The first method (if not my_list) is the most "Pythonic." It is clean and efficient.

Common Uses for Empty Lists

Empty lists are starting points. They are used in many programming patterns.

1. Collecting Data: Start empty and append items in a loop.


squares = []
for i in range(5):
    squares.append(i ** 2)
print(squares)
    

[0, 1, 4, 9, 16]
    

2. Initializing a List of Objects: You might create a list to hold custom objects. Learn more in our guide on Python List of Objects.

3. As a Default Function Argument: Be careful. Using a mutable default like [] can cause bugs.


# Problematic: Mutable default argument
def add_item(item, my_list=[]):
    my_list.append(item)
    return my_list

print(add_item('a'))  # Expect ['a']
print(add_item('b'))  # Oops! Returns ['a', 'b'] not ['b']

# Solution: Use None as default
def add_item_safe(item, my_list=None):
    if my_list is None:
        my_list = []  # Create a new empty list here
    my_list.append(item)
    return my_list
    

['a']
['a', 'b']
    

Performance and Memory

Both [] and list() are efficient. The square bracket method is a tiny bit faster.

This is because [] is a literal. Python creates the list directly. The list() call involves a function lookup.

For most code, the difference is negligible. Choose based on readability.

Conclusion

Defining an empty list in Python is simple. Use square brackets [] for most cases. Use the list() constructor when it makes your code clearer.

Remember to check for empty lists using if not my_list. This is the Pythonic way.

Empty lists are the foundation for data collection. They are used in loops, functions, and data processing. Mastering this basic concept is key to effective Python programming.

As you work with lists, you might need to convert a Python list to a set to remove duplicates. Or, you might encounter a common error like the Python list index out of range error. Understanding empty lists helps you avoid and fix these issues.

Start with an empty list and build your data from there.