Ask Your Question

Revision history [back]

To complement Thierry's answer, here is another way to get a reversed list:

sage: L = [4,2,5,1,3]
sage: L[::-1]
[3, 1, 5, 2, 4]

This produces a new list. The original list is unchanged.