You can append the elements of one list to another with the "+=" operator. Note that the "+" operator creates a new list.

a = [1, 2, 3]
b = [10, 20]

a = a + b # Create a new list a+b and assign back to a.
print a
# [1, 2, 3, 10, 20]


# Equivalently:
a = [1, 2, 3]
b = [10, 20]

a += b
print a
# [1, 2, 3, 10, 20]

If you want to append the lists and keep them as lists, then try:

result = []
result.append(a)
result.append(b)
print result
# [[1, 2, 3], [10, 20]]
Answer from stackoverflowuser2010 on Stack Overflow
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-add-to-array
Python Array Add: How to Append, Extend & Insert Elements | DigitalOcean
April 15, 2025 - Learn how to add elements to an array in Python using append(), extend(), insert(), and NumPy functions. Compare performance and avoid common errors.
Discussions

Append method not working
I ran a simple python code on jupyter notebook for just testing the append method It is not working. It gives none as output. The code is as given below. List = [1,2,3,4] Newlist = List.append(7) print(Newlist) Output:- None I am new to python so please help me with this code and correct the ... More on discuss.python.org
🌐 discuss.python.org
0
April 8, 2023
How do I append a value to an array in Python? - Stack Overflow
For a numerical analysis class I need to make a for loop that must do a couple of things: Make a certain 'Dt' (a time step that gets smaller and smaller) and add this to an array called Dt_list. T... More on stackoverflow.com
🌐 stackoverflow.com
What is Python's list.append() method WORST Time Complexity? It can't be O(1), right?
I've read on Stackoverflow that in Python Array doubles in size when run of space It's actually not double, but it does increase proportional to the list size (IIRC it's about 12%, though there's some variance at smaller sizes). This does result in the same asymptotics though, so I'll assume doubling in the following description for simplicity. So basically it has to copy all addresses log(n) times. Not quite. Suppose we're appending n items to an empty vector. We will indeed do log(n) resizes, so you might think "Well, resizes are O(n), so log(n) resizes is n log(n) operations, which if we amortize over the n appends we did means n log(n)/n, or log(n) per append". However, there's a flaw in this analysis: we do not copy "all addresses" each of those times. Ie. the copies are not O(n). Sure, the last copy we do will involve copying n items, but the one before it only copied n/2, and so on. So we actually do 1 + 2 + 4 + ... + n copies, which sums to 2n-1. Divide that by n and you get ~2 operations per append - a constant. I assume since it copies addresses, not information We are indeed only copying the pointer, but this doesn't really matter for the complexity analysis. Even if it was copying a large structure, that'd only increase the time by a constant factor. Does that mean that O(1) is the average time complexity? It's the amortized worst case complexity (ie. what happens over a large number of operations). While any one operation can indeed end up doing O(n) operations, there's an important distinction that over a large number of operations, you are guaranteed to only be O(1), which is a distinction just talking about average case wouldn't capture. More on reddit.com
🌐 r/learnpython
11
3
October 26, 2022
Numpy Array Append
Just so you know: A numpy array is not made to be appended to like a list is. In the background of np.append an entire new array has to be created, so it's expensive (slow). It's much better to use lists if you need to append data. More on reddit.com
🌐 r/learnpython
5
1
February 14, 2019
🌐
freeCodeCamp
freecodecamp.org › news › append-in-python-how-to-append-to-a-list-or-an-array
Append in Python – How to Append to a List or an Array
January 7, 2022 - In this article, you'll learn about the .append() method in Python. You'll also see how .append() differs from other methods used to add elements to lists. Let's get started! An array in programming is an ordered collection of items, and all items need to be of the same data type.
🌐
Python documentation
docs.python.org › 3 › reference › datamodel.html
3. Data model — Python 3.14.3 documentation
Extension modules (written in C, Java, or other languages, depending on the implementation) can define additional types. Future versions of Python may add types to the type hierarchy (e.g., rational numbers, efficiently stored arrays of integers, etc.), although such additions will often be provided via the standard library instead.
🌐
Python.org
discuss.python.org › python help
Append method not working - Python Help - Discussions on Python.org
April 8, 2023 - I ran a simple python code on jupyter notebook for just testing the append method It is not working. It gives none as output. The code is as given below. List = [1,2,3,4] Newlist = List.append(7) print(Newlist) Out…
🌐
Namehero
namehero.com › blog › how-to-append-an-item-to-a-python-array
How to Append an Item to a Python Array
April 17, 2024 - To explicitly use arrays instead of lists in Python, you need to import the “array” module. Here’s a series of commands designed to show you how to create an array, append an item to it, and print the output:
Find elsewhere
🌐
NumPy
numpy.org › doc › stable › user › absolute_beginners.html
NumPy: the absolute basics for beginners — NumPy v2.4 Manual
After installing NumPy, it may be imported into Python code like: ... This widespread convention allows access to NumPy features with a short, recognizable prefix (np.) while distinguishing NumPy features from others that have the same name. Throughout the NumPy documentation, you will find blocks that look like: >>> a = np.array([[1, 2, 3], ...
🌐
W3Schools
w3schools.com › python › gloss_python_array_add.asp
Python Add Array Item
Python Examples Python Compiler ... Q&A Python Bootcamp Python Certificate Python Training ... You can use the append() method to add an element to an array....
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.append.html
numpy.append — NumPy v2.1 Manual
Delete elements from an array. ... >>> import numpy as np >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]]) array([1, 2, 3, ..., 7, 8, 9])
🌐
W3Schools
w3schools.com › python › python_arrays.asp
Python Arrays
You can use the append() method to add an element to an array. ... You can use the pop() method to remove an element from the array. ... You can also use the remove() method to remove an element from the array.
🌐
Quora
quora.com › How-do-I-add-to-an-array-in-Python
How to add to an array in Python - Quora
Answer (1 of 3): I am assuming you’re talking about “Lists” in python. You can append/add data to a list in python with the “append” method. Eg: arrList.append(“data”). You may want to check out 5. Data Structures - Python 3.9.4 documentation
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.append.html
numpy.append — NumPy v2.5.dev0 Manual
Delete elements from an array. ... Try it in your browser! >>> import numpy as np >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]]) array([1, 2, 3, ..., 7, 8, 9])
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python append element to array
Python Append Element to Array - Spark By {Examples}
May 31, 2024 - How to append an element to an array in Python? In Python, you can use the append() method to append an element to the end of an array. However, it’s important to note that Python does not have a built-in array data type, but you can use lists, ...
🌐
Mimo
mimo.org › glossary › python › append()
Python List append Method: Dynamic List Expansion | Learn Now
When collecting or generating data in a loop, append() can add an element at a time to a list. Once you’ve created a list using square brackets ([]), you can use the append() method on it. This use case is beneficial for beginners learning how to manipulate lists in Python.
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › append
Python Numpy append() - Add Elements to Array | Vultr Docs
April 10, 2025 - Here, python append to numpy array is done efficiently by appending elements to a list first, then converting it to a NumPy array in one step.
🌐
IONOS
ionos.com › digital guide › websites › web development › python append
How to use Python append to extend lists - IONOS
October 30, 2023 - While Python-append is most used for managing lists, it can be applied to other common data structures in Python. However, there are a few important differences that you need to be aware of. Python Arrays aren’t part of the standard Python library and must be imported from an external Python ...
🌐
Python documentation
docs.python.org › 3 › tutorial › datastructures.html
5. Data Structures — Python 3.14.3 documentation
The list methods make it very easy to use a list as a stack, where the last element added is the first element retrieved (“last-in, first-out”). To add an item to the top of the stack, use append(). To retrieve an item from the top of the ...
🌐
Stack Overflow
stackoverflow.com › questions › 72489660 › how-do-i-append-a-value-to-an-array-in-python
How do I append a value to an array in Python? - Stack Overflow
This function returns a one dimensional array with two components: ([est_global_error_1, est_global_error_2]) This output has to also be added to an array called: err_list being a two dimensional array. inside the for loop there must be a (nested) 'if' that checks whether or not one of the values in the global_trunction_error is smaller than or equal to 0.001, if this is the case the for loop must break. Although seemingly easy, I can not get it to work properly after trying many variations. There seems to be something going wrong when I try to append a value to either one of the lists.
🌐
freeCodeCamp
freecodecamp.org › news › python-list-append-how-to-add-an-item-to-a-list-in-python
Python List .append() – How to Add an Item to a List in Python
April 14, 2022 - Let's combine two arrays odd and even into a single list using the + operator. ... odd = [1, 3, 5, 7] even = [2, 4, 6, 8] odd += even # odd = odd + even # Output: [1, 2, 3, 4] print('odd and even combined =', odd) ... There are two ways to populate empty lists: using a for loop with append() and using list comprehension.
🌐
Python
docs.python.org › 3 › library › itertools.html
itertools — Functions creating iterators for efficient looping
5 days ago - def tee(iterable, n=2): if n < 0: raise ValueError if n == 0: return () iterator = _tee(iterable) result = [iterator] for _ in range(n - 1): result.append(_tee(iterator)) return tuple(result) class _tee: def __init__(self, iterable): it = iter(iterable) if isinstance(it, _tee): self.iterator = it.iterator self.link = it.link else: self.iterator = it self.link = [None, None] def __iter__(self): return self def __next__(self): link = self.link if link[1] is None: link[0] = next(self.iterator) link[1] = [None, None] value, self.link = link return value