manipulating-lists/quickref.tex
author anand
Mon, 15 Nov 2010 14:31:42 +0530
changeset 498 4255f995a40c
parent 423 0f0f4993cffe
permissions -rw-r--r--
checklist not OK; one more long answer question has to be included.

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