September 2018
Intermediate to advanced
426 pages
10h 46m
English
Another interesting operations that we have in lists is the one that offers the possibility of going back to the list through the reverse () method:
>>> protocolList.reverse()>>> print protocolList
['smtp','http','ftp']
Another way to do the same operation use the -1 index. This quick and easy technique shows how you can access all the elements of a list in reverse order:
>>> protocolList[::-1]>>> print protocolList
['smtp','http','ftp']