Python List - append method

add an element to the end of the list with the append method extended by the python list object

List Updated 11 Sep 2016 1 min read

Method Name

append

Method Signature

append(element_in)

Method Overview

  • The append() method adds an element to the end of a Python list object.

Parameters

element_in: The element to be added to the Python list

Return Value

None

Example

python
# Example Python program that appends

            # an element to a Python list

# Create a list with few elements

            ironOres = ["Magnetite", "Hematite", "Limonite"];

# Append an element to the end of the list

            ironOres.append("Siderite");

            print("Iron ores:");

            print(ironOres);

Output

Output
Iron ores:

            ['Magnetite', 'Hematite', 'Limonite', 'Siderite']