Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How reverse a list with Sage?

See on http://www.sagemath.org/doc/thematic_tutorials/tutorial-programming-python.html

From the section "Modifying lists: reverse, sort, ...":

L = [4,2,5,1,3]

L.reverse()

sage: [3, 1, 5, 2, 4]

However I see -- nothing.

print L.reverse()

gives 'None'. I am using Sage 5.8.