Python List Append() Syntax

List_name.append(element)

Parameter

  • element: an element (number, string, list, etc.) to be added at the end of the list. The parameter is mandatory and omitting it can cause an error.

Python List append() Method

Python list append() method is used to add elements at the end of the list.

Example

Python




list=[2,5,6,7]
list.append(8)
print(list)


Output

[2, 5, 6, 7, 8]

Similar Reads

Python List Append() Syntax

...

What is List Append() in Python?

List_name.append(element)...

More Python List append() Examples of

Python list append function is a pre-defined function that takes a value as a parameter and adds it at the end of the list. append() function can take any type of data as input, including a number, a string, a decimal number, a list, or another object....