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