using_sage_to_teach/questions.rst
author bhanu
Mon, 08 Nov 2010 01:34:02 +0530
changeset 454 0c69c2b32183
parent 262 0038edaf660c
permissions -rw-r--r--
Language check done for the script `strings`
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     1
Objective Questions
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     2
-------------------
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     3
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
     4
 1. which default argument, when used with ``@interact`` gives a slider 
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
     5
    starting at 0 and ending in 10
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     6
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
     7
   a. (0..11)
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
     8
   #. range(0, 11)
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
     9
   #. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    10
   #. (0..10)
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    11
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    12
   Answer: (0..10)
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    13
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    14
 2. What is the input widget resulted by using ``n = [2, 4, 5, 9]`` in the
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    15
    default arguments along with ``@interact``
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    16
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    17
   a. input field
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    18
   #. set of buttons
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    19
   #. slider
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    20
   #. None
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    21
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    22
   Answer: set of buttons
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    23
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    24
 3. what is the type of ``n`` in the following function::
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    25
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    26
        @interact
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    27
        def f(n=2.5):
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    28
            # do something with n
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    29
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    30
   a. int
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    31
   #. float
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    32
   #. string
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    33
   #. complex
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    34
262
0038edaf660c Added questions
Nishanth <nishanth@fossee.in
parents: 256
diff changeset
    35
   Answer: float
256
a3aa223c1662 added script to using_sage_to_teach
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    36