getting-started-with-lists/quickref.tex
author Anoop Jacob Thomas<anoop@fossee.in>
Sun, 07 Nov 2010 16:20:02 +0530
changeset 394 1a79f9ee7f5c
parent 342 588b681e70c6
permissions -rw-r--r--
made changes to script, matrices, using array() instead of matrix() now.

Creating an list\\
{\ex \lstinline| empty=[]|}

Create a filled list\\
{\ex \lstinline| nonempty = ['spam', 'eggs', 100, 1.234]  |}

Accessing a list\\
{\ex \lstinline|    nonempty[0] |}
{\ex \lstinline|    nonempty[-1] |}

Length of a list\\
{\ex \lstinline|    len(nonempty) |}

Append an element to a list\\
{\ex \lstinline|    nonempty.append('python') |}

Remove elements of a list\\
{\ex \lstinline|    del(nonempty[1] |}
{\ex \lstinline|  nonempty.remove(100) |}