Easy Tutorial
❮ Python Func Range Python String ❯

Python3 List append() Method

Python3 List


Description

The append() method is used to add a new object to the end of the list.

Syntax

Syntax of the append() method:

list.append(obj)

Parameters

Return Value

This method does not return any value but modifies the original list.

Example

The following example demonstrates the use of the append() function:

#!/usr/bin/python3

list1 = ['Google', 'tutorialpro', 'Taobao']
list1.append('Baidu')
print("Updated list : ", list1)

The output of the above example is as follows:

Updated list :  ['Google', 'tutorialpro', 'Taobao', 'Baidu']

Python3 List

❮ Python Func Range Python String ❯