Copyright © tutorialspoint.com

Python List append() Method

previous next


Description:

This method appends a passed obj into the existing list.

Syntax:

list.append(obj)

Parameters:

Here is the detail of parameters:

Return Value:

It returns none but updates existing list.

Example:

#!/usr/bin/python

aList = [123, 'xyz', 'zara', 'abc'];
aList.append( 2009 );
print "Updated List : ", aList;

This will produce following result:

Updated List :  [123, 'xyz', 'zara', 'abc', 2009]

previous next

Copyright © tutorialspoint.com