Python List append()

Python List.append()

Python List append() method appends element to the end of this list.

Python List append()

The syntax to use append() function to add element at the end of the list is


append() method modifies the source list.

append() method returns None.


1. Append item 98 to the given list

In the following program, we define a list of elements [52, 41, 63]. Then, we append an element 98 to this list using append() method.

Python Program

myList = [52, 41, 63]
Run Code Online


[52, 41, 63, 98]

2. Append another list to this list

You can use append() function to append another list of element to this list.

In the following program, we shall use for loop to iterate over elements of second list and append each of these elements to the first list.

Python Program

list_1 = [52, 41, 63]
list_2 = [47, 27, 97]

for element in list_2:

Run Code Online


[52, 41, 63, 47, 27, 97]


In this tutorial of Python Examples, we learned how to use List.append() method to append an element to the list.

⫷ Previous tutorialNext tutorial ⫸