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