User Tools

Site Tools


Getting the contents of a list in reverse order.

Say you have a list like this


And you'd actually like to get the contents from the end of the list this is how you could do it:


The command above would give you the contents of the list only from back to front

['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF']

This could come in quite handy if you have long lists and you don't want to manually split them up in order to reverse them.

niftypythoncommands.txt · Last modified: 2012/03/09 10:43 (external edit)