Changes to manipulating lists quickref.
authorPuneeth Chaganti <punchagan@fossee.in>
Tue, 09 Nov 2010 16:14:58 +0530
changeset 423 0f0f4993cffe
parent 422 f29d9014e1fc
child 424 19f49715e83f
Changes to manipulating lists quickref.
manipulating-lists/quickref.tex
--- a/manipulating-lists/quickref.tex	Tue Nov 09 16:08:26 2010 +0530
+++ b/manipulating-lists/quickref.tex	Tue Nov 09 16:14:58 2010 +0530
@@ -1,8 +1,10 @@
-Creating a linear array:\\
-{\ex \lstinline|    x = linspace(0, 2*pi, 50)|}
+Slicing \& Striding a list:\\
+{\ex \lstinline|    A[start:stop:step]|} \lstinline|stop| excluded
 
-Plotting two variables:\\
-{\ex \lstinline|    plot(x, sin(x))|}
+Sorting a list:\\
+{\ex \lstinline|    sorted(A)|} -- returns new list
+{\ex \lstinline|    A.sort()|} -- in-place sort
 
-Plotting two lists of equal length x, y:\\
-{\ex \lstinline|    plot(x, y)|}
+Reversing a list:\\
+{\ex \lstinline|    A[::-1]|} -- returns new list
+{\ex \lstinline|    A.reverse()|} -- in-place reverse