using_sage_to_teach/quickref.tex
changeset 334 4b1e81da1c80
parent 256 a3aa223c1662
equal deleted inserted replaced
333:91b427241f8f 334:4b1e81da1c80
     1 Creating a tuple:\\
     1 using @interact:\\
     2 {\ex \lstinline|    t = (1, "hello", 2.5)|}
     2 {\ex \lstinline|    @interact
       
     3                     def f(a=5,b=[1,2],c=(0..3))|}
     3 
     4 
     4 Accessing elements of tuples:\\
     5 Default argument for a field input:\\
     5 {\ex \lstinline|    t[index] Ex: t[2]|}
     6 {\ex \lstinline|    def f(a="hello")|}
     6 
     7 
     7 Accessing slices of tuples:\\
     8 Default argument for slider:\\
     8 {\ex \lstinline|    t[start:stop:step]|}
     9 {\ex \lstinline|    def f(a=(1..8))|}
     9 
    10 
    10 Swapping values:\\
    11 Default argument for buttons:\\
    11 {\ex \lstinline|    a, b = b, a|}
    12 {\ex \lstinline|    def f(a=[1, 2, 3])|}
       
    13 
       
    14 Publish worksheets:\\
       
    15 {\ex \lstinline|    Use Publish option on top right corner|}
       
    16 
       
    17 Re-Publish worksheets:\\
       
    18 {\ex \lstinline|    Check the auto re-publish option while publishing or click
       
    19 on publish and click on the re-publish option on the page.|}
       
    20 
       
    21 Share the worksheets:\\
       
    22 {\ex \lstinline|    Click on the share button and enter the usernames|}
       
    23 
       
    24 Editing a published worksheet:\\
       
    25 {\ex \lstinline|    Open the worksheet and click on the edit button on top left
       
    26 corner|}