using_sage_to_teach/quickref.tex
changeset 256 a3aa223c1662
child 334 4b1e81da1c80
equal deleted inserted replaced
255:75fd106303dc 256:a3aa223c1662
       
     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|}