blob: d571a9e72b3057058d4479029911e2c5c27bd949 (
plain)
1
2
3
4
5
6
7
8
9
10
|
Slicing \& Striding a list:\\
{\ex \lstinline| A[start:stop:step]|} \lstinline|stop| excluded
Sorting a list:\\
{\ex \lstinline| sorted(A)|} -- returns new list
{\ex \lstinline| A.sort()|} -- in-place sort
Reversing a list:\\
{\ex \lstinline| A[::-1]|} -- returns new list
{\ex \lstinline| A.reverse()|} -- in-place reverse
|