tuples/quickref.tex
author anand
Thu, 11 Nov 2010 00:24:11 +0530
changeset 474 f137f3e036d9
parent 232 da873a5ac918
permissions -rw-r--r--
checklist OK for `gettin started with for loops` 1;2305;0c

Creating a tuple:\\
{\ex \lstinline|    t = (1, "hello", 2.5)|}

Accessing elements of tuples:\\
{\ex \lstinline|    t[index] Ex: t[2]|}

Accessing slices of tuples:\\
{\ex \lstinline|    t[start:stop:step]|}

Swapping values:\\
{\ex \lstinline|    a, b = b, a|}