Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python List append() Method


previous next AddThis Social Bookmark Button


Description:

This method appends a passed obj into the existing list.

Syntax:

list.append(obj)

Parameters:

Here is the detail of parameters:

  • obj: object to be appended in the list.

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 Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names