manipulating-lists/quickref.tex
author bhanu
Thu, 11 Nov 2010 00:22:53 +0530
changeset 473 7eaa550929a1
parent 423 0f0f4993cffe
permissions -rw-r--r--
Language check Done for `getting started with for loop`

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