manipulating-lists/quickref.tex
author Amit Sethi
Wed, 10 Nov 2010 12:23:40 +0530
changeset 441 430035b678f7
parent 423 0f0f4993cffe
permissions -rw-r--r--
Exercises for getting started with lists and some changes based on review

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