list.reverse

s.reverse() reverses the items of s in place

The list.sort and list.reverse methods modify the list in place for economy of space when sorting or reversing a large list. To remind you that they operate by side effect, they don’t return the sorted or reversed list.

 

Comment:

There should be a mention that, for iterating over a list in reverse order, the reversed() function is preferred.

Posted by Roberto Bonvallet (2006-10-27)

A Django site. rendered by a django application. hosted by webfaction.