author | nishanth |
Thu, 01 Jul 2010 17:05:57 +0530 | |
changeset 86 | 404e9c1b8cff |
parent 59 | 0b57494e8b4e |
child 89 | f8e25dea5222 |
permissions | -rw-r--r-- |
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> |
456b7b9e3d13
created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
diff
changeset
|
2 |
|
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
3 |
<question> |
59 | 4 |
<topic>Plotting</topic> |
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
5 |
<description> |
46 | 6 |
Describe the plot produced by the following code |
7 |
</description> |
|
8 |
<time_limit> |
|
9 |
30 |
|
10 |
</time_limit> |
|
11 |
<code> |
|
12 |
In []: x = linspace(0, 2*pi, 50) |
|
13 |
In []: plot(x, cos(x), 'go') |
|
14 |
</code> |
|
15 |
<expected_answer> |
|
16 |
Correct this question manually |
|
17 |
</expected_answer> |
|
18 |
</question> |
|
19 |
||
20 |
<question> |
|
59 | 21 |
<topic>Plotting</topic> |
46 | 22 |
<description> |
23 |
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? |
|
24 |
</description> |
|
25 |
<time_limit> |
|
26 |
30 |
|
27 |
</time_limit> |
|
28 |
<expected_answer> |
|
29 |
\%hist \%save |
|
30 |
</expected_answer> |
|
31 |
</question> |
|
32 |
||
33 |
<question> |
|
59 | 34 |
<topic>Plotting</topic> |
46 | 35 |
<description> |
36 |
How do you set the x and y labels of a plot to "x" and "sin(x)" ? |
|
37 |
</description> |
|
38 |
<time_limit> |
|
39 |
60 |
|
40 |
</time_limit> |
|
41 |
<expected_answer> |
|
42 |
xlabel \( \" x \" \) ylabel \( \"sin\(x\)\" \) |
|
43 |
xlabel \( \" x \" \) ylabel \( \'sin\(x\)\' \) |
|
44 |
xlabel \( \' x \' \) ylabel \( \"sin\(x\)\" \) |
|
45 |
xlabel \( \' x \' \) ylabel \( \'sin\(x\)\' \) |
|
46 |
</expected_answer> |
|
47 |
</question> |
|
48 |
||
49 |
<question> |
|
59 | 50 |
<topic>Plotting</topic> |
46 | 51 |
<description> |
52 |
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
|
53 |
</description> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
54 |
<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
|
55 |
90 |
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
56 |
</time_limit> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
57 |
<expected_answer> |
46 | 58 |
xlim \( 0 , 2 \* pi \) [;,\n+] ylim \( -1\.5 , 1\.5 \) |
59 |
</expected_answer> |
|
60 |
</question> |
|
61 |
||
62 |
<question> |
|
59 | 63 |
<topic>Lists and Files</topic> |
46 | 64 |
<description> |
65 |
How do you combine two lists a and b to produce one list? |
|
66 |
</description> |
|
67 |
<time_limit> |
|
68 |
30 |
|
69 |
</time_limit> |
|
70 |
<expected_answer> |
|
71 |
a \+ b |
|
72 |
</expected_answer> |
|
73 |
</question> |
|
74 |
||
75 |
<question> |
|
59 | 76 |
<topic>Lists and Files</topic> |
46 | 77 |
<description> |
78 |
If a = [1, 2, 5, 9] how do you add 10 to the end of this list ? |
|
79 |
</description> |
|
80 |
<time_limit> |
|
81 |
30 |
|
82 |
</time_limit> |
|
83 |
<expected_answer> |
|
84 |
a\.append \( 10 \) |
|
85 |
a = a \+ \[ 10 \] |
|
86 |
a \+= \[ 10 \] |
|
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
87 |
</expected_answer> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
88 |
</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
|
89 |
|
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
90 |
<question> |
59 | 91 |
<topic>Lists and Files</topic> |
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
92 |
<description> |
46 | 93 |
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
|
94 |
</description> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
95 |
<time_limit> |
46 | 96 |
60 |
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
97 |
</time_limit> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
98 |
<expected_answer> |
46 | 99 |
correct this manually |
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
100 |
</expected_answer> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
101 |
</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
|
102 |
|
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
103 |
<question> |
59 | 104 |
<topic>For Loops</topic> |
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
105 |
<description> |
46 | 106 |
The following code snippet has an error/bug. |
107 |
What is the error? |
|
108 |
</description> |
|
109 |
<code> |
|
110 |
In []: l = [0.1, 0.2, 0.3, 0.4] |
|
111 |
In []: t = [0.69, 0.90, 1.19, 1.30] |
|
112 |
In []: tsq = [] |
|
113 |
In []: for time in t: |
|
114 |
....: tsq.append(time*time) |
|
115 |
....: plot(l, tsq) |
|
116 |
</code> |
|
117 |
<time_limit> |
|
118 |
60 |
|
119 |
</time_limit> |
|
120 |
<expected_answer> |
|
121 |
plot |
|
122 |
</expected_answer> |
|
123 |
</question> |
|
124 |
||
125 |
<question> |
|
59 | 126 |
<topic>Strings</topic> |
46 | 127 |
<description> |
128 |
"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
|
129 |
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
|
130 |
</description> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
131 |
<time_limit> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
132 |
30 |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
133 |
</time_limit> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
134 |
<expected_answer> |
46 | 135 |
\.split \( " , " \) |
136 |
\.split \( ' , ' \) |
|
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
137 |
</expected_answer> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
138 |
</question> |
29 | 139 |
|
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
140 |
<question> |
59 | 141 |
<topic>Lists and Files</topic> |
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
142 |
<description> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
143 |
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
|
144 |
</description> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
145 |
<time_limit> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
146 |
30 |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
147 |
</time_limit> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
148 |
<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
|
149 |
len \( a \) |
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
150 |
</expected_answer> |
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
151 |
</question> |
29 | 152 |
|
46 | 153 |
<question> |
59 | 154 |
<topic>Dictionaries and Piecharts</topic> |
46 | 155 |
<description> |
156 |
What is the output of the following code snippet |
|
157 |
</description> |
|
158 |
<code> |
|
47 | 159 |
In [1]: d = {'a': 1, |
160 |
'b': 2 |
|
161 |
} |
|
46 | 162 |
In [2]: print d['c'] |
163 |
</code> |
|
164 |
<time_limit> |
|
165 |
30 |
|
166 |
</time_limit> |
|
167 |
<expected_answer> |
|
168 |
error |
|
169 |
Error |
|
170 |
ERROR |
|
171 |
</expected_answer> |
|
172 |
</question> |
|
173 |
||
174 |
<question> |
|
59 | 175 |
<topic>Dictionaries and Piecharts</topic> |
46 | 176 |
<description> |
177 |
Given the below dictionary, what command will you give to plot a pie-chart? |
|
178 |
</description> |
|
179 |
<code> |
|
47 | 180 |
In []: sc = {'A': 10, 'B': 20, 'C': 70} |
46 | 181 |
</code> |
182 |
<time_limit> |
|
183 |
60 |
|
184 |
</time_limit> |
|
185 |
<expected_answer> |
|
186 |
pie \( sc\.values \( \) \) |
|
187 |
pie \( sc\.values \( \) , labels = sc\.keys \( \) \) |
|
188 |
</expected_answer> |
|
189 |
</question> |
|
190 |
||
191 |
<question> |
|
59 | 192 |
<topic>Statistics</topic> |
46 | 193 |
<description> |
194 |
Given the below marks, how will you calculate the mean? |
|
195 |
</description> |
|
196 |
<code> |
|
47 | 197 |
In []: marks = [10, 20, 30, 50, 55, 75, 83] |
46 | 198 |
</code> |
199 |
<time_limit> |
|
200 |
30 |
|
201 |
</time_limit> |
|
202 |
<expected_answer> |
|
203 |
mean \( marks \) |
|
204 |
sum \( marks \) \/ len \( marks \) |
|
205 |
</expected_answer> |
|
206 |
</question> |
|
207 |
||
208 |
<question> |
|
59 | 209 |
<topic>Arrays and Matrices</topic> |
46 | 210 |
<description> |
211 |
How will you convert the list marks to an array? |
|
212 |
</description> |
|
213 |
<code> |
|
214 |
In []: marks = [10, 20, 30, 50, 55, 75, 83] |
|
215 |
</code> |
|
216 |
<time_limit> |
|
217 |
30 |
|
218 |
</time_limit> |
|
219 |
<expected_answer> |
|
220 |
array \( marks \) |
|
221 |
</expected_answer> |
|
222 |
</question> |
|
223 |
||
47 | 224 |
<question> |
59 | 225 |
<topic>Arrays and Matrices</topic> |
47 | 226 |
<description> |
227 |
What is the value of a after executing this code. |
|
228 |
</description> |
|
229 |
<code> |
|
230 |
In []: a = array([[1, 2], |
|
231 |
[3, 4]]) |
|
232 |
In []: a[1,0] = 0 |
|
233 |
</code> |
|
234 |
<time_limit> |
|
235 |
60 |
|
236 |
</time_limit> |
|
237 |
<expected_answer> |
|
238 |
\[ \[ 1 , 2 \] , \[ 0 , 4 \] \] |
|
239 |
</expected_answer> |
|
240 |
</question> |
|
241 |
||
242 |
<question> |
|
59 | 243 |
<topic>Arrays and Matrices</topic> |
47 | 244 |
<description> |
245 |
What will be printed? |
|
246 |
</description> |
|
247 |
<code> |
|
248 |
In []: x = array(([1,2,3,4], |
|
249 |
[2,3,4,5])) |
|
250 |
In []: x[-2][-3] = 4 |
|
251 |
In []: print x |
|
252 |
</code> |
|
253 |
<time_limit> |
|
254 |
90 |
|
255 |
</time_limit> |
|
256 |
<expected_answer> |
|
257 |
array \( \( \[ 4 , 2 , 3 , 4 \] , \[ 2 , 3 , 4 , 5 \] \) \) |
|
258 |
array \( \[ \[ 4 , 2 , 3 , 4 \] , \[ 2 , 3 , 4 , 5 \] \] \) |
|
259 |
\[ \[ 4 , 2 , 3 , 4 \] , \[ 2 , 3 , 4 , 5 \] \] |
|
260 |
\( \[ 4 , 2 , 3 , 4 \] , \[ 2 , 3 , 4 , 5 \] \) |
|
261 |
</expected_answer> |
|
262 |
</question> |
|
263 |
||
264 |
<question> |
|
59 | 265 |
<topic>Arrays and Matrices</topic> |
47 | 266 |
<description> |
267 |
If x = array([[1,2,3,4]]) How to change x to array([[1,2,0,4]]) ? |
|
268 |
</description> |
|
269 |
<time_limit> |
|
270 |
60 |
|
271 |
</time_limit> |
|
272 |
<expected_answer> |
|
273 |
x\[ 0 \]\[ 2 \] = 0 |
|
274 |
</expected_answer> |
|
275 |
</question> |
|
276 |
||
277 |
<question> |
|
59 | 278 |
<topic>Arrays and Matrices</topic> |
47 | 279 |
<description> |
280 |
||
281 |
x = array([[1,2,3,4], |
|
282 |
[3,4,2,5]]) |
|
283 |
||
284 |
How do you get the following slice of x ? |
|
285 |
||
286 |
array([[2,3], |
|
287 |
[4,2]]) |
|
288 |
||
289 |
</description> |
|
290 |
<time_limit> |
|
291 |
60 |
|
292 |
</time_limit> |
|
293 |
<expected_answer> |
|
294 |
x\[ \: , 1 \: 3 \] |
|
295 |
x\[ \: , 1 \: -1 \] |
|
296 |
x\[ \: , -3 \: -1 \] |
|
297 |
</expected_answer> |
|
298 |
</question> |
|
299 |
||
300 |
<question> |
|
59 | 301 |
<topic>Arrays and Matrices</topic> |
47 | 302 |
<description> |
303 |
What is the output of x[::3,::3] |
|
304 |
</description> |
|
305 |
<code> |
|
306 |
In []: x = array([[9,18,27], |
|
307 |
[30,60,90], |
|
308 |
[14,7,1]]) |
|
309 |
</code> |
|
310 |
<time_limit> |
|
311 |
30 |
|
312 |
</time_limit> |
|
313 |
<expected_answer> |
|
314 |
9 |
|
315 |
</expected_answer> |
|
316 |
</question> |
|
317 |
||
318 |
<question> |
|
59 | 319 |
<topic>Arrays and Matrices</topic> |
47 | 320 |
<description> |
321 |
How do you get the transpose of this array? |
|
322 |
</description> |
|
323 |
<code> |
|
324 |
In []: a = array([[1, 2], |
|
325 |
[3, 4]]) |
|
326 |
</code> |
|
327 |
<time_limit> |
|
328 |
30 |
|
329 |
</time_limit> |
|
330 |
<expected_answer> |
|
331 |
a\.T |
|
332 |
</expected_answer> |
|
333 |
</question> |
|
334 |
||
335 |
<question> |
|
59 | 336 |
<topic>Arrays and Matrices</topic> |
47 | 337 |
<description> |
338 |
What does this produce? |
|
339 |
</description> |
|
340 |
<code> |
|
341 |
In []: a = array([[1, 2], |
|
342 |
[3, 4]]) |
|
343 |
In []: b = array([[1, 1], |
|
344 |
[2, 2]]) |
|
345 |
In []: a*b |
|
346 |
</code> |
|
347 |
<time_limit> |
|
348 |
45 |
|
349 |
</time_limit> |
|
350 |
<expected_answer> |
|
351 |
array \( \[ \[ 1 , 2 \] , \[ 6 , 8 \] \] \) |
|
352 |
\[ \[ 1 , 2 \] , \[ 6 , 8 \] \] |
|
353 |
</expected_answer> |
|
354 |
</question> |
|
355 |
||
356 |
<question> |
|
59 | 357 |
<topic>Arrays and Matrices</topic> |
47 | 358 |
<description> |
359 |
What command do you use to find the inverse of a matrix and its eigenvalues? |
|
360 |
</description> |
|
361 |
<time_limit> |
|
362 |
30 |
|
363 |
</time_limit> |
|
364 |
<expected_answer> |
|
365 |
inv .* eigvals |
|
366 |
</expected_answer> |
|
367 |
</question> |
|
368 |
||
369 |
<question> |
|
59 | 370 |
<topic>Solving linear equations</topic> |
47 | 371 |
<description> |
372 |
Given a 4x4 matrix A and a 4-vector b , what command do you use to solve for the equation Ax = b ? |
|
373 |
</description> |
|
374 |
<time_limit> |
|
375 |
45 |
|
376 |
</time_limit> |
|
377 |
<expected_answer> |
|
378 |
solve \( A , b \) |
|
379 |
</expected_answer> |
|
380 |
</question> |
|
381 |
||
382 |
<question> |
|
59 | 383 |
<topic>Finding roots</topic> |
47 | 384 |
<description> |
385 |
How do you calculate the roots of the polynomial, y = 1 + 6*x + 8*x^2 + x^3 |
|
386 |
</description> |
|
387 |
<time_limit> |
|
388 |
45 |
|
389 |
</time_limit> |
|
390 |
<expected_answer> |
|
391 |
roots \( \[ 1 , 8 , 6 , 1 \] \) |
|
392 |
</expected_answer> |
|
393 |
</question> |
|
394 |
||
395 |
<question> |
|
59 | 396 |
<topic>Solving linear equations</topic> |
47 | 397 |
<description> |
398 |
Two arrays a and b are numerically almost equal, what command do you use to check if this is true? |
|
399 |
</description> |
|
400 |
<time_limit> |
|
401 |
30 |
|
402 |
</time_limit> |
|
403 |
<expected_answer> |
|
404 |
allclose \( a , b \) |
|
405 |
allclose \( b , a \) |
|
406 |
</expected_answer> |
|
407 |
</question> |
|
408 |
||
49 | 409 |
<question> |
59 | 410 |
<topic>Basic Datatypes</topic> |
49 | 411 |
<description> |
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
412 |
What is the largest integer value that can be represented by Python? |
49 | 413 |
</description> |
414 |
<time_limit> |
|
415 |
30 |
|
416 |
</time_limit> |
|
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
417 |
<options> |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
418 |
No Limit |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
419 |
2**32 |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
420 |
2**32 - 1 |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
421 |
None of the above |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
422 |
</options> |
49 | 423 |
<expected_answer> |
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
424 |
No Limit |
49 | 425 |
</expected_answer> |
426 |
</question> |
|
427 |
||
428 |
<question> |
|
59 | 429 |
<topic>Basic Datatypes</topic> |
49 | 430 |
<description> |
431 |
What is the result of 17.0 / 2? |
|
432 |
</description> |
|
433 |
<time_limit> |
|
434 |
15 |
|
435 |
</time_limit> |
|
436 |
<expected_answer> |
|
437 |
8.5 |
|
438 |
</expected_answer> |
|
439 |
</question> |
|
440 |
||
441 |
<question> |
|
59 | 442 |
<topic>Basic Datatypes</topic> |
49 | 443 |
<description> |
444 |
Which of the following is not a type in Python? |
|
445 |
</description> |
|
446 |
<time_limit> |
|
447 |
30 |
|
448 |
</time_limit> |
|
449 |
<options> |
|
450 |
int |
|
451 |
float |
|
452 |
char |
|
453 |
string |
|
454 |
</options> |
|
455 |
<expected_answer> |
|
456 |
char |
|
457 |
</expected_answer> |
|
458 |
</question> |
|
459 |
||
460 |
||
461 |
<question> |
|
59 | 462 |
<topic>Basic Datatypes</topic> |
49 | 463 |
<description> |
464 |
How do you create a complex number with real part 2 and imaginary part 0.5 ? |
|
465 |
</description> |
|
466 |
<time_limit> |
|
467 |
30 |
|
468 |
</time_limit> |
|
469 |
<expected_answer> |
|
470 |
2 \+ 0\.5j |
|
471 |
complex \( 2 , 0\.5 \) |
|
472 |
</expected_answer> |
|
473 |
</question> |
|
474 |
||
475 |
<question> |
|
59 | 476 |
<topic>Input and Output</topic> |
49 | 477 |
<description> |
478 |
What is the difference between print x and print x, |
|
479 |
</description> |
|
480 |
<time_limit> |
|
481 |
30 |
|
482 |
</time_limit> |
|
483 |
<expected_answer> |
|
484 |
correct manually |
|
485 |
</expected_answer> |
|
486 |
</question> |
|
487 |
||
488 |
<question> |
|
59 | 489 |
<topic>Input and Output</topic> |
49 | 490 |
<description> |
491 |
What does 't' * 40 produce? |
|
492 |
</description> |
|
493 |
<time_limit> |
|
494 |
30 |
|
495 |
</time_limit> |
|
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
496 |
<options> |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
497 |
40 |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
498 |
tttttttttttttttttttttttttttttttttttttttt |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
499 |
t40 |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
500 |
Error |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
501 |
</options> |
49 | 502 |
<expected_answer> |
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
503 |
tttttttttttttttttttttttttttttttttttttttt |
49 | 504 |
</expected_answer> |
505 |
</question> |
|
506 |
||
507 |
<question> |
|
59 | 508 |
<topic>Basic Datatypes</topic> |
49 | 509 |
<description> |
510 |
What is the output? |
|
511 |
</description> |
|
512 |
<code> |
|
513 |
In []: ', '.join(['a', 'b', 'c']) |
|
514 |
</code> |
|
515 |
<time_limit> |
|
516 |
30 |
|
517 |
</time_limit> |
|
518 |
<expected_answer> |
|
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
519 |
"a, b, c" |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
520 |
'a, b, c' |
49 | 521 |
</expected_answer> |
522 |
</question> |
|
523 |
||
524 |
<question> |
|
59 | 525 |
<topic>Basic Datatypes</topic> |
49 | 526 |
<description> |
527 |
What is the output? |
|
528 |
</description> |
|
529 |
<code> |
|
530 |
In []: 47 % 3 |
|
531 |
</code> |
|
532 |
<time_limit> |
|
533 |
45 |
|
534 |
</time_limit> |
|
535 |
<expected_answer> |
|
536 |
2 |
|
537 |
</expected_answer> |
|
538 |
</question> |
|
539 |
||
540 |
<question> |
|
59 | 541 |
<topic>Lists and Tuples</topic> |
49 | 542 |
<description> |
543 |
How do you find the presence of an element x in the list a |
|
544 |
</description> |
|
545 |
<time_limit> |
|
546 |
30 |
|
547 |
</time_limit> |
|
548 |
<expected_answer> |
|
549 |
x in a |
|
550 |
</expected_answer> |
|
551 |
</question> |
|
552 |
||
553 |
<question> |
|
59 | 554 |
<topic>Sets</topic> |
49 | 555 |
<description> |
556 |
What is the output |
|
557 |
</description> |
|
558 |
<code> |
|
559 |
In []: set([1, 2, 8, 2, 13, 8, 9]) |
|
560 |
</code> |
|
561 |
<time_limit> |
|
562 |
45 |
|
563 |
</time_limit> |
|
564 |
<expected_answer> |
|
565 |
set \( \[ 1 , 2 , 8 , 13 , 9 \] \) |
|
566 |
\[ 1 , 2 , 8 , 13 , 9 \] |
|
567 |
</expected_answer> |
|
568 |
</question> |
|
569 |
||
570 |
<question> |
|
59 | 571 |
<topic>Dictionaries</topic> |
49 | 572 |
<description> |
573 |
What is the output |
|
574 |
</description> |
|
575 |
<code> |
|
576 |
In []: a = {'a': 1, 'b': 2} |
|
577 |
In []: a['a'] = 10 |
|
578 |
In []: print a |
|
579 |
</code> |
|
580 |
<time_limit> |
|
581 |
60 |
|
582 |
</time_limit> |
|
583 |
<expected_answer> |
|
584 |
\{ \'a\' \: 10 , \'b\' \: 2 \} |
|
585 |
\{ \'a\' \: 10 , \"b\" \: 2 \} |
|
586 |
\{ \"a\" \: 10 , \"b\" \: 2 \} |
|
587 |
\{ \"a\" \: 10 , \'b\' \: 2 \} |
|
588 |
</expected_answer> |
|
589 |
</question> |
|
590 |
||
591 |
<question> |
|
59 | 592 |
<topic>Lists and Tuples</topic> |
49 | 593 |
<description> |
594 |
What is the value of a after executing this code. |
|
595 |
</description> |
|
596 |
<code> |
|
597 |
In []: a = [1, 2, 3] |
|
598 |
In []: a.extend([5, 6]) |
|
599 |
</code> |
|
600 |
<time_limit> |
|
601 |
45 |
|
602 |
</time_limit> |
|
603 |
<expected_answer> |
|
604 |
\[ 1 , 2 , 3 , 5 , 6 \] |
|
605 |
</expected_answer> |
|
606 |
</question> |
|
607 |
||
608 |
<question> |
|
59 | 609 |
<topic>Lists and Tuples</topic> |
49 | 610 |
<description> |
611 |
What is the output? |
|
612 |
</description> |
|
613 |
<code> |
|
614 |
In []: a = (1, 2, 3) |
|
615 |
In []: a[1] = 10 |
|
616 |
</code> |
|
617 |
<time_limit> |
|
618 |
30 |
|
619 |
</time_limit> |
|
620 |
<expected_answer> |
|
621 |
error |
|
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
622 |
Error |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
623 |
ERROR |
49 | 624 |
</expected_answer> |
625 |
</question> |
|
626 |
||
627 |
<question> |
|
59 | 628 |
<topic>Functions</topic> |
49 | 629 |
<description> |
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
630 |
What is the value of func(1), if |
49 | 631 |
</description> |
632 |
<code> |
|
633 |
def func(x, y=10): |
|
634 |
print x+1, y+10 |
|
635 |
</code> |
|
636 |
<time_limit> |
|
637 |
60 |
|
638 |
</time_limit> |
|
639 |
<expected_answer> |
|
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
640 |
2 20 |
49 | 641 |
</expected_answer> |
642 |
</question> |
|
643 |
||
644 |
<question> |
|
59 | 645 |
<topic>Functions</topic> |
49 | 646 |
<description> |
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
647 |
How many items can a function return ? |
49 | 648 |
</description> |
649 |
<time_limit> |
|
650 |
30 |
|
651 |
</time_limit> |
|
50
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
652 |
<options> |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
653 |
One |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
654 |
Multiple |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
655 |
Two |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
656 |
None |
0842b3439c3e
implemented extra filter on string patterns. now string patterns will not be split like other pattersns
nishanth
parents:
49
diff
changeset
|
657 |
</options> |
49 | 658 |
<expected_answer> |
659 |
Multiple |
|
660 |
</expected_answer> |
|
661 |
</question> |
|
662 |
||
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
|
663 |
</questionbank> |