The method reverse() reverses objects of list in place.
Following is the syntax for reverse() method:
list.reverse()
NA
This method does not return any value but reverse the given object from the list.
The following example shows the usage of reverse() method.
#!/usr/bin/python
aList = [123, 'xyz', 'zara', 'abc', 'xyz'];
aList.reverse();
print "List : ", aList;
When we run above program, it produces following result:
List : ['xyz', 'abc', 'zara', 'xyz', 123]