Copyright © tutorialspoint.com
This method reverses objects of list in place.
list.reverse() |
Here is the detail of parameters:
NA
It returns none but reverse the given object from the list.
#!/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] |
Copyright © tutorialspoint.com