added questions from day2 quiz1
authornishanth
Thu, 22 Apr 2010 06:23:53 +0530
changeset 49 3643f59f141e
parent 48 aae2f69ba89c
child 50 0842b3439c3e
added questions from day2 quiz1
question_bank.xml
quiz/management/commands/seed_que.py
--- a/question_bank.xml	Thu Apr 22 05:41:35 2010 +0530
+++ b/question_bank.xml	Thu Apr 22 06:23:53 2010 +0530
@@ -387,5 +387,226 @@
 </question>
 
 </day1quiz2>
+<day2quiz1>
 
+<question>
+<description>
+What is the largest integer value that can be represented natively by Python?
+</description>
+<time_limit>
+30
+</time_limit>
+<expected_answer>
+correct manually
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the result of 17.0 / 2?
+</description>
+<time_limit>
+15
+</time_limit>
+<expected_answer>
+8.5
+</expected_answer>
+</question>
+
+<question>
+<description>
+Which of the following is not a type in Python?
+</description>
+<time_limit>
+30
+</time_limit>
+<options>
+int
+float
+char
+string
+</options>
+<expected_answer>
+char
+</expected_answer>
+</question>
+
+
+<question>
+<description>
+How do you create a complex number with real part 2 and imaginary part 0.5 ?
+</description>
+<time_limit>
+30
+</time_limit>
+<expected_answer>
+2 \+ 0\.5j
+complex \( 2 , 0\.5 \)
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the difference between print x and print x,
+</description>
+<time_limit>
+30
+</time_limit>
+<expected_answer>
+correct manually
+</expected_answer>
+</question>
+
+<question>
+<description>
+What does 't' * 40 produce?
+</description>
+<time_limit>
+30
+</time_limit>
+<expected_answer>
+correct manually
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the output?
+</description>
+<code>
+In []: ', '.join(['a', 'b', 'c'])
+</code>
+<time_limit>
+30
+</time_limit>
+<expected_answer>
+correct manually
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the output?
+</description>
+<code>
+In []: 47 % 3 
+</code>
+<time_limit>
+45
+</time_limit>
+<expected_answer>
+2
+</expected_answer>
+</question>
+
+<question>
+<description>
+How do you find the presence of an element x in the list a
+</description>
+<time_limit>
+30
+</time_limit>
+<expected_answer>
+x in a
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the output
+</description>
+<code>
+In []: set([1, 2, 8, 2, 13, 8, 9])
+</code>
+<time_limit>
+45
+</time_limit>
+<expected_answer>
+set \( \[ 1 , 2 , 8 , 13 , 9 \] \)
+\[ 1 , 2 , 8 , 13 , 9 \]
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the output
+</description>
+<code>
+In []: a = {'a': 1, 'b': 2} 
+In []: a['a'] = 10
+In []: print a
+</code>
+<time_limit>
+60
+</time_limit>
+<expected_answer>
+\{ \'a\' \: 10 , \'b\' \: 2 \}
+\{ \'a\' \: 10 , \"b\" \: 2 \}
+\{ \"a\" \: 10 , \"b\" \: 2 \}
+\{ \"a\" \: 10 , \'b\' \: 2 \}
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the value of a after executing this code.
+</description>
+<code>
+In []: a = [1, 2, 3] 
+In []: a.extend([5, 6])
+</code>
+<time_limit>
+45
+</time_limit>
+<expected_answer>
+\[ 1 , 2 , 3 , 5 , 6 \]
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the output?
+</description>
+<code>
+In []: a = (1, 2, 3)
+In []: a[1] = 10
+</code>
+<time_limit>
+30
+</time_limit>
+<expected_answer>
+error
+</expected_answer>
+</question>
+
+<question>
+<description>
+What is the value of func(1) where
+</description>
+<code>
+def func(x, y=10):
+    print x+1, y+10
+</code>
+<time_limit>
+60
+</time_limit>
+<expected_answer>
+2 10
+2 , 10
+</expected_answer>
+</question>
+
+<question>
+<description>
+How many items can a function return 
+</description>
+<time_limit>
+30
+</time_limit>
+<expected_answer>
+Multiple
+</expected_answer>
+</question>
+
+</day2quiz1>
 </questionbank>
--- a/quiz/management/commands/seed_que.py	Thu Apr 22 05:41:35 2010 +0530
+++ b/quiz/management/commands/seed_que.py	Thu Apr 22 06:23:53 2010 +0530
@@ -20,6 +20,7 @@
 
         description_node = question.getElementsByTagName("description")[0]
         description = (description_node.childNodes[0].data).strip()
+        print description
 
         time_limit_node = question.getElementsByTagName("time_limit")[0]
         time_limit = time_limit_node.childNodes[0].data