writing_python_scripts/quickref.tex
changeset 296 641a6ee868c0
child 335 d5248a15274c
equal deleted inserted replaced
287:d9507624eb8f 296:641a6ee868c0
       
     1 Creating a tuple:\\
       
     2 {\ex \lstinline|    t = (1, "hello", 2.5)|}
       
     3 
       
     4 Accessing elements of tuples:\\
       
     5 {\ex \lstinline|    t[index] Ex: t[2]|}
       
     6 
       
     7 Accessing slices of tuples:\\
       
     8 {\ex \lstinline|    t[start:stop:step]|}
       
     9 
       
    10 Swapping values:\\
       
    11 {\ex \lstinline|    a, b = b, a|}