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