The reverse () method is used to reverse the elements of the list.
Example
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
list1 = ['MIT', 'CIT', 'Yale','UCI']
print(list1)
list1.reverse()
print(list1)
Output:
['MIT', 'CIT', 'Yale', 'UCI']
['UCI', 'Yale', 'CIT', 'MIT']
Syntax
list.reverse()
Parameters
This method doesn’t take any parameters.
Return Value
It doesn’t return any value.