5.3.14 Reversing order in a list
The
revlist
command reverses the elements of a list or sequence.
revlist
takes
L
, a list or sequence.
revlist(
L
)
returns a list or sequence with the same elements as
L
in the reverse order.
Examples
revlist
([0,1,2,3,4])
⎡
⎣
4,3,2,1,0
⎤
⎦
revlist
([0,1,2,3,4],3)
3,
⎡
⎣
0,1,2,3,4
⎤
⎦