Home >>Python List Methods >Python List append() Method

Python List append() Method

Python List append() Method

Python list append() method is used to append or add a given input element to the end of the list.

Syntax:
list.append(elmnt)

Parameter Values

Parameter Description
elmnt This is a required parameter. It defines an element of any type.
Here is an example of Python append() method:

fruits = ["apple", "banana", "mango"]
fruits.append("orange")
print(fruits)

Output:
['apple', 'banana', 'mango', 'orange']
Example 2:

a = ["a", "b", "c"]
b = ["1", "2", "3"]
a.append(b)
print(a)

Output:
['a', 'b', 'c', ['1', '2', '3']]

No Sidebar ads