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 reverse() Method


previous next AddThis Social Bookmark Button


Description:

This method reverses objects of list in place.

Syntax:

list.reverse()

Parameters:

Here is the detail of parameters:

  • NA

Return Value:

It returns none but reverse the given object from the list.

Example:

#!/usr/bin/python

aList = [123, 'xyz', 'zara', 'abc', 'xyz'];

aList.reverse();
print "List : ", aList;

This will produce following result:

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


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names