Python List - append() Method
The Python append() method is used to add an element to end of the list.
Syntax
list.append(elem)
Parameters
elem |
Required. value of the element which need to be added in the list. |
Return Value
None.
Example:
In the example below, list append() method is used to add an element called 'SUN' to the end of the list called MyList.
MyList = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'] MyList.append('SUN') print(MyList)
The output of the above code will be:
['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
❮ Python List Methods