question_bank.xml
author nishanth
Thu, 22 Apr 2010 04:24:19 +0530
changeset 46 b45bb982ae24
parent 39 0fa055b8ea98
child 47 8a837762531b
permissions -rw-r--r--
added few more questions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
456b7b9e3d13 created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
diff changeset
     1
<questionbank>
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
     2
<day1quiz1>
28
456b7b9e3d13 created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
diff changeset
     3
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
     4
<question>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
     5
<description>
46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
     6
Describe the plot produced by the following code
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
     7
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
     8
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
     9
30
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    10
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    11
<code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    12
In []: x = linspace(0, 2*pi, 50)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    13
In []: plot(x, cos(x), 'go')
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    14
</code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    15
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    16
Correct this question manually
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    17
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    18
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    19
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    20
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    21
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    22
What ipython magic command do you use to obtain the lines of code you have already typed in the interpreter? What command do you use to save them?
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    23
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    24
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    25
30
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    26
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    27
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    28
\%hist \%save
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    29
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    30
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    31
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    32
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    33
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    34
How do you set the x and y labels of a plot to "x" and "sin(x)" ?
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    35
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    36
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    37
60
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    38
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    39
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    40
xlabel \( \" x \" \) ylabel \( \"sin\(x\)\" \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    41
xlabel \( \" x \" \) ylabel \( \'sin\(x\)\' \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    42
xlabel \( \' x \' \) ylabel \( \"sin\(x\)\" \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    43
xlabel \( \' x \' \) ylabel \( \'sin\(x\)\' \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    44
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    45
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    47
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    48
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    49
How will you set the x and y axis limits so that the region of interest is in the rectangle (0, -1.5) and (2 pi, 1.5)?
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    50
</description>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    51
<time_limit>
39
0fa055b8ea98 implemented correct_quiz function and added it at the time of closing quiz and modified question bank
nishanth
parents: 33
diff changeset
    52
90
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    53
</time_limit>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    54
<expected_answer>
46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    55
xlim \( 0 , 2 \* pi \) [;,\n+] ylim \( -1\.5 , 1\.5 \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    56
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    57
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    58
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    59
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    60
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    61
How do you combine two lists a and b to produce one list?
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    62
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    63
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    64
30
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    65
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    66
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    67
a \+ b
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    68
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    69
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    70
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    71
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    72
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    73
If a = [1, 2, 5, 9] how do you add 10 to the end of this list ?
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    74
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    75
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    76
30
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    77
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    78
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    79
a\.append \( 10 \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    80
a = a \+ \[ 10 \]
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    81
a \+= \[ 10 \]
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    82
</expected_answer>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    83
</question>
28
456b7b9e3d13 created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
diff changeset
    84
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    85
<question>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    86
<description>
46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    87
Write the code to read a file "data.txt" and print each line of it?
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    88
</description>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    89
<time_limit>
46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    90
60
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    91
</time_limit>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    92
<expected_answer>
46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    93
correct this manually
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    94
</expected_answer>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    95
</question>
28
456b7b9e3d13 created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
diff changeset
    96
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    97
<question>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    98
<description>
46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
    99
The following code snippet has an error/bug.
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   100
What is the error?
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   101
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   102
<code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   103
In []: l = [0.1, 0.2, 0.3, 0.4]
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   104
In []: t = [0.69, 0.90, 1.19, 1.30]
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   105
In []: tsq = []
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   106
In []: for time in t:
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   107
 ....:     tsq.append(time*time)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   108
 ....:     plot(l, tsq)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   109
</code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   110
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   111
60
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   112
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   113
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   114
plot
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   115
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   116
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   117
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   118
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   119
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   120
"Rossum, Guido, 42, 56, 34, 54" is a sample line from a Comma Separated Values (CSV) file
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   121
What code would you use to separate the line into fields?
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   122
</description>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   123
<time_limit>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   124
30
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   125
</time_limit>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   126
<expected_answer>
46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   127
\.split \( " , " \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   128
\.split \( ' , ' \)
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   129
</expected_answer>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   130
</question>
29
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
   131
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   132
<question>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   133
<description>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   134
If a = [1, 2, 5, 9] how do you find the length of this list?
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   135
</description>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   136
<time_limit>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   137
30
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   138
</time_limit>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   139
<expected_answer>
39
0fa055b8ea98 implemented correct_quiz function and added it at the time of closing quiz and modified question bank
nishanth
parents: 33
diff changeset
   140
len \( a \)
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   141
</expected_answer>
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   142
</question>
29
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
   143
46
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   144
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   145
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   146
What is the output of the following code snippet
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   147
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   148
<code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   149
In [1]: d = {
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   150
	  'a': 1,
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   151
	  'b': 2
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   152
	  }
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   153
In [2]: print d['c']
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   154
</code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   155
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   156
30
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   157
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   158
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   159
error
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   160
Error
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   161
ERROR
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   162
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   163
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   164
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   165
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   166
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   167
Given the below dictionary, what command will you give to plot a pie-chart?
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   168
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   169
<code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   170
In []: sc = {'A': 10, 'B': 20, 
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   171
             'C': 70}
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   172
</code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   173
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   174
60
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   175
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   176
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   177
pie \( sc\.values \( \) \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   178
pie \( sc\.values \( \) , labels = sc\.keys \( \) \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   179
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   180
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   181
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   182
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   183
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   184
Given the below marks, how will you calculate the mean?
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   185
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   186
<code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   187
In []: marks = [10, 20, 30, 50, 55, 
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   188
                75, 83] 
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   189
</code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   190
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   191
30
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   192
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   193
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   194
mean \( marks \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   195
sum \( marks \) \/ len \( marks \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   196
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   197
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   198
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   199
<question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   200
<description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   201
How will you convert the list marks to an array?
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   202
</description>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   203
<code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   204
In []: marks = [10, 20, 30, 50, 55, 75, 83]
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   205
</code>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   206
<time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   207
30
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   208
</time_limit>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   209
<expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   210
array \( marks \)
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   211
</expected_answer>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   212
</question>
b45bb982ae24 added few more questions
nishanth
parents: 39
diff changeset
   213
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   214
</day1quiz1>
29
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
   215
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
   216
<day1quiz2>
29
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
   217
</day1quiz2>
28
456b7b9e3d13 created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
diff changeset
   218
456b7b9e3d13 created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
diff changeset
   219
</questionbank>