Python List append() Method

Adds an item to the end of the list.

Syntax

Python
list.append(item)

Parameters

ParameterDescription
item Required. The item to append to the end of the list. It can be of any type.

Example

Python
groceries = ['apples', 'oranges', 'paper towels']
groceries.append("tomato soup")
print(groceries)

Output

['apples', 'oranges', 'paper towels', 'tomato soup']