Python List append() Method
Instance
Add elements to the fruits list:
fruits = ['apple', 'banana', 'cherry'] fruits.append("orange")
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 Instances
Instance
Add a list to the list:
a = ["apple", "banana", "cherry"] b = ["Porsche", "BMW", "Volvo"] a.append(b)