You haven't created three different empty lists. You've created one empty list, and then created a new list with three references to that same empty list. To fix the problem use this code instead:

listy = [[] for i in range(3)]

Running your example code now gives the result you probably expected:

>>> listy = [[] for i in range(3)]
>>> listy[1] = [1,2]
>>> listy
[[], [1, 2], []]
>>> listy[1].append(3)
>>> listy
[[], [1, 2, 3], []]
>>> listy[2].append(1)
>>> listy
[[], [1, 2, 3], [1]]
Answer from Mark Byers on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › appending-to-2d-list-in-python
Appending to 2D List in Python - GeeksforGeeks
July 23, 2025 - += operator allows you to extend a sublist with multiple elements in a concise manner. ... This is equivalent to using extend(). If we want to append multiple sublists dynamically list comprehension is a concise option.
🌐
Dot Net Perls
dotnetperls.com › 2d-python
Python - 2D List Examples - Dot Net Perls
# ... Append empty lists in first two indexes. elements = [] elements.append([]) elements.append([]) # Step 2: add elements to empty lists. elements[ ... 0]) print(elements) # Step 4: loop over rows. for row in elements: # Loop over columns. for column in row: print(column, end="") print(end="\n") ... The term "jagged" implies that sub lists have uneven lengths. Here we create a list of 2 lists—one of length 2, the other of length 5. We display their lengths. Info This is a list of lists, not exactly a 2D list.
🌐
Python Forum
python-forum.io › thread-30401.html
Append 2d empty lists
Hi there! I wanted to store my functions result in a 2d list. The function returns 5 values and has to run 100 times in a for loop. I tried to initiate a storage list by ding this: list1 = [[]]*5which returns list1 = [[], [], [], [], []] However, w...
🌐
Delft Stack
delftstack.com › home › howto › python › append 2d array python
How to Append 2D Array in Python | Delft Stack
February 22, 2025 - Python’s built-in lists can represent 2D arrays as lists of lists. The simplest way to append values is using the append() method.
🌐
YouTube
youtube.com › watch
How Does Append Work With 2d Lists In Python - YouTube
In this python tutorial we are talking about lists in python! Specifically, we are answering the question of how does append work with 2d lists in python! Le...
Published   January 4, 2023
Find elsewhere
🌐
Python Pool
pythonpool.com › home › blog › python 2d list: from basic to advance
Python 2d List: From Basic to Advance - Python Pool
January 1, 2024 - Also, it would be very easy to retrieve the values from the list. We will learn how to retrieve values from a 2d list in python. append(): append() is quite a common function used on a list.
🌐
Codecademy Forums
discuss.codecademy.com › computer science
#12 how am I suppose to add to the 2d list? - Computer Science - Codecademy Forums
April 11, 2023 - You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility When you ask a question, don’t forget to include a link to the exercis…
🌐
Snakify
snakify.org › two-dimensional lists (arrays)
Two-dimensional lists (arrays) - Learn Python 3 - Snakify
The list [0] * m is n times consructed as the new one, and no copying of references occurs. Say, a program takes on input two-dimensional array in the form of n rows, each of which contains m numbers separated by spaces. How do you force the program to read it? An example of how you can do it: ... # the first line of input is the number of rows of the array n = int(input()) a = [] for i in range(n): a.append([int(j) for j in input().split()])
🌐
YouTube
youtube.com › watch
2d array python append - YouTube
Instantly Download or Run the code at https://codegive.com title: an in-depth guide to appending elements in a 2d array in pythonintroduction:in python, a 2...
Published   March 13, 2024
🌐
Reddit
reddit.com › r/learnpython › copying 1d lists to form a 2d list
r/learnpython on Reddit: Copying 1D lists to form a 2D list
May 26, 2023 -

I'm new to python and I've been given a task that requires me to append/copy a 1d list multiple times to form a 2d list, while also modifying the values of the 2d list.
But every time I've attempted it I get the same issue, that whenever I change the value of one entry in the 2d list, it changes that value for the entire column which I'm doing by "2dlist[x][y] = 1".
I've tried the following.
2dlist.Append(1dlist)
2dlist += 1dlist
2dlist = [1dlist for i in range(number)]
1dlist *= number
And several other methods that all resulted in the same issue or worse.

I'm not allowed to import libraries and I've ran out ideas. Am I mis-understanding something about python lists? Is "2dlist[x][y] = 1" at fault? Any and all help/tips/resources is GREATLY appreciated.

Example
1dlist = [1, 2, 3, 4, 5]
and I'm trying to get 2dlist to equal
[[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5]]

Then modifying each value to get
[[1, 0, 3, 0, 5], #multiply 1, remove even
[0, 4, 0, 8, 0], #multiply 2, remove odd
[3, 0, 9, 0, 15], #multiply 3, remove even
[0, 8, 0, 16, 0]] #multiply 4, remove odd

What I'm getting
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]]
Because it removes the evens in all rows then all odds in each column

🌐
Processing
py.processing.org › tutorials › 2dlists
Two-Dimensional Lists \ Tutorials
Python Mode for Processing extends the Processing Development Environment with the Python programming language.
🌐
Thedeveloperblog
thedeveloperblog.com › 2d-list-python
Python 2D List Examples
We can access elements on each list with an index. With nested lists, we can create a lookup table or rectangular grid. Jagged row lengths, where each row has a different number of elements, are also allowed. General idea. We create an empty list and add empty lists to it with append().
🌐
Guru99
guru99.com › home › python › python 2d arrays: two-dimensional list examples
Python 2D Arrays: Two-Dimensional List Examples
August 12, 2024 - Here are two methods for updating values in the 2-D array(list). ... #creare 2D array with 4 rows and 5 columns array=[[23,45,43,23,45],[45,67,54,32,45],[89,90,87,65,44],[23,45,67,32,10]] #update row values in the 3rd row array[2]=[0,3,5,6,7] #update row values in the 5th row array[2]=[0,3,5,6,7] #update the first row , third column array[0][2]=100 #update the second row , third column array[1][2]=400 #display print(array)