Python List append() Method

Example

Add elements to the fruits list:

fruits = ['apple', 'banana', 'cherry']
fruits.append("orange")

Run Instance

Definition and Usage

The append() method appends an element to the end of the list.

Syntax

list.append(element)

Parameter Value

Parameter Description
element Required. Elements of any type (string, number, object, etc.).

More Examples

Example

Add a list to the list:

a = ["apple", "banana", "cherry"]
b = ["Porsche", "BMW", "Volvo"]
a.append(b)

Run Instance