The actual reason why you can't do either of the following,

l = [].append(2)
l = [2,3,4].append(1)

is because .append() always returns None as a function return value. .append() is meant to be done in place.

See here for docs on data structures. As a summary, if you want to initialise a value in a list do:

l = [2]

If you want to initialise an empty list to use within a function / operation do something like below:

l = []
for x in range(10):
    value = a_function_or_operation()
    l.append(value)

Finally, if you really want to do an evaluation like l = [2,3,4].append(), use the + operator like:

l1 = []+[2]
l2 = [2,3,4] + [2]
print l1, l2
>>> [2] [2, 3, 4, 2]   

This is generally how you initialise lists.

Answer from Alexander McFarlane on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › append-element-to-an-empty-list-in-python
Append Elements to Empty List in Python - GeeksforGeeks
July 23, 2025 - In Python, lists are used to store multiple items in one variable. If we have an empty list and we want to add elements to it, we can do that in a few simple ways. The simplest way to add an item in empty list is by using the append() method.
Discussions

Can we make a one-liner the pattern "if the object is a list, append a value to it, otherwise initialize it with an empty list and append the value to it"
For a dictionary there is .setdefault cache = {} cache.setdefault("banned_users", []).append("foo") However, cache = defaultdict(list) is generally recommended instead. https://docs.python.org/3/library/collections.html#defaultdict-examples More on reddit.com
🌐 r/learnpython
15
7
December 15, 2023
Quick way to append non-blank elements in a list to another list?
I have Python 3.12 on Windows 10. If I have list1 and list2, I would like a quick way to append non-blank items in list1 into list2. Example. Below is how I do it now. Is there a list comprehension that might do this? … More on discuss.python.org
🌐 discuss.python.org
4
0
August 28, 2024
What happens when we append an empty list to itself in python ?
A way you can prevent this from ... copy of the list. If you also want new copies for the object elements of the list then you will need to make a deep copy. deepcopy() ... The appended empty list is added as an element to the previously empty list.... More on sololearn.com
🌐 sololearn.com
5
6
python - Appending an empty list to a list does append previous list contents - Stack Overflow
When you then overwrote A, you created a new list at x03 and set A to point there. However, B is still pointing at x02, which is still pointing at x01, which still holds a 1! Therefore, when you now append A to B, B is pointing at a location in memory (x02) which has two pointers: one at x01 and one at x03. x01 holds a 1 and x03 is empty... More on stackoverflow.com
🌐 stackoverflow.com
🌐
DataCamp
datacamp.com › tutorial › python-empty-list
A Comprehensive Guide to Python Empty Lists | DataCamp
February 2, 2024 - A drawback of .append() is that it only adds elements at the end of a list — this means that we have no control over where exactly to insert a new element when using .append(). The .insert() method, on the other hand, allows us to do exactly that. Here we pick up the example from the previous section and insert ’Truly’ between ’Python’ and ’Rocks!’. Note that Python uses zero-based indexing, which means that the index of the first element of the list is 0. Check out the example for more details: # Initialize an empty list my_list = [] # Append elements my_list.append('Python') my_list.append('Rocks!') my_list.append('It’s easy to learn!') # `my_list` is now ['Python', 'Rocks!', 'It’s easy to learn!'] # Showcase zero-based indexing in Python my_list[0] # Returns 'Python' my_list[1] # Returns 'Rocks' my_list[2] # Returns 'It's easy to learn!'
🌐
freeCodeCamp
freecodecamp.org › news › python-empty-list-tutorial-how-to-create-an-empty-list-in-python
Python Empty List Tutorial – How to Create an Empty List in Python
June 18, 2020 - If you want to learn how to create an empty list in Python efficiently, then this article is for you. You will learn: How to create an empty list using square brackets []. How to create an empty list using list(). Their use cases. How efficient th...
🌐
Python.org
discuss.python.org › python help
Quick way to append non-blank elements in a list to another list? - Python Help - Discussions on Python.org
August 28, 2024 - I have Python 3.12 on Windows 10. If I have list1 and list2, I would like a quick way to append non-blank items in list1 into list2. Example. Below is how I do it now. Is there a list comprehension that might do this? list1 = ['one', '', 'two', '', 'three'] list2 = ['new'] for l in list1: if l: list2.append(l) # list2 will be: ['new', 'one', 'two', 'three'] Thank you.
Find elsewhere
🌐
Vultr Docs
docs.vultr.com › python › standard library › list › append()
Python List append() - Add Element to List
November 6, 2024 - It modifies the list in-place and returns None. Create a list and add a single element using append(). ... This code initializes an empty list named fruit_list, and adds the string 'apple' to the list.
🌐
Real Python
realpython.com › python-append
Python's .append(): Add Items to Your Lists in Place – Real Python
March 18, 2026 - One common use case of .append() is to completely populate an empty list using a for loop. Inside the loop, you can manipulate the data and use .append() to add successive results to the list.
🌐
Quora
quora.com › What-happens-when-you-try-to-append-an-empty-list-to-another-list-in-Python
What happens when you try to append an empty list to another list in Python? - Quora
Answer: If you append an empty list to another list using the append() method, that empty list is appended to that other list, and so the length of the other list increases by 1. If you append an empty list to another list using the extend() method, the other list doesn’t change as there ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › add-values-into-an-empty-list-from-python-for-loop
Add Values into Empty List Using For Loop - Python - GeeksforGeeks
July 23, 2025 - # Create an empty list a = [] # Initialize the counter i = 0 # Use a while loop to add values while i < 5: a.append(i) i += 1 # Print the list print(a)
🌐
jdhao's digital space
jdhao.github.io › 2020 › 11 › 22 › python_list_of_empty_list_pitfall
The Correct Way to Create List of Empty List in Python · jdhao's digital space
February 1, 2022 - TL;DR: do not use list multiplication to initialize an empty list of list, or you will end up wasting hours debugging your program. I wrote some Python code for my project and found that the result isn’t correct. So I spent quite some time debugging the whole working process of this program, and found sadly that the culprit is a list of empty list, which is wrongly initialized. What is the resulting list, if we do the following in Python? x = [[]] * 3 x[0].append(1.0) I expect x now becomes [[1.0], [], []]. Instead, it becomes [[1.0], [1.0], [1.0]]. This is because when we use multiplication to create list x, we actually created 3 references to an empty list.
🌐
Python documentation
docs.python.org › 3 › tutorial › datastructures.html
5. Data Structures — Python 3.14.7 documentation
You can’t use lists as keys, since lists can be modified in place using index assignments, slice assignments, or methods like append() and extend(). It is best to think of a dictionary as a set of key: value pairs, with the requirement that the keys are unique (within one dictionary). A pair of braces creates an empty ...
🌐
Python
docs.python.org › 3 › library › itertools.html
itertools — Functions creating iterators for efficient looping
When the iterable is exhausted, return elements from the saved copy. Repeats indefinitely. Roughly equivalent to: def cycle(iterable): # cycle('ABCD') → A B C D A B C D A B C D ... saved = [] for element in iterable: yield element saved.append(element) while saved: for element in saved: yield element
🌐
Pierian Training
pieriantraining.com › home › how to create an empty list in python
How to Create and Use an Empty List in Python
April 27, 2023 - Here are two ways to create an empty list: ... The simplest and most common way to create an empty list is by using a set of square brackets []. The code looks like this: ... This will create an empty list named my_list.
🌐
Statistics Globe
statisticsglobe.com › home › python programming language for statistics & data science › append to empty list in python (3 examples)
How to Append Elements to Empty List in Python (3 Examples)
June 19, 2023 - my_list = my_list + [1, 2, 3] # append 1, 2 and 3 print(my_list) # print my_list # [1, 2, 3] Now, our list is updated by the given values. You can also prefer to save the result under a new object name and keep my_list empty. Do you need further information on the topics of this article? Then I recommend watching the following video on my YouTube channel. In the video, I demonstrate the Python programming codes of this post in Python.
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-add-to-list
How to Add Elements to a List in Python – Append, Insert & Extend | DigitalOcean
Learn how to add elements to a list in Python using append(), insert(), extend(). Compare performance, avoid common mistakes with this guide.
🌐
Quora
quora.com › What-is-the-reason-that-appending-an-empty-string-to-a-list-in-Python-creates-the-same-list-rather-than-adding-the-new-item-to-the-end-of-the-list
What is the reason that appending an empty string to a list in Python creates the same list rather than adding the new item to the end of the list? - Quora
Answer: It works. I don’t know how did you do that? I guess you might have not put the quotations. In the following screenshot, you can see that I use [code ]append[/code] to add a space at the end of a list and also use [code ]insert[/code] to add a space at index 1 of the list.
🌐
W3Schools
w3schools.com › python › python_lists.asp
Python Lists
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Training ... Lists are used to store multiple items in a single variable.