Question

In Python, how to reverse a list?


Annonce
Ad

Answer

>>> myList=['a','b','c','d']
>>> myList.reverse()
>>> myList
['d', 'c', 'b', 'a']


[source]
# ID Query