# HG changeset patch # User nishanth # Date 1271897633 -19800 # Node ID 3643f59f141e0fff0dd9875a630f0862993176dc # Parent aae2f69ba89cd55aab1cc47a33be0a5676337276 added questions from day2 quiz1 diff -r aae2f69ba89c -r 3643f59f141e question_bank.xml --- 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 @@ + + + +What is the largest integer value that can be represented natively by Python? + + +30 + + +correct manually + + + + + +What is the result of 17.0 / 2? + + +15 + + +8.5 + + + + + +Which of the following is not a type in Python? + + +30 + + +int +float +char +string + + +char + + + + + + +How do you create a complex number with real part 2 and imaginary part 0.5 ? + + +30 + + +2 \+ 0\.5j +complex \( 2 , 0\.5 \) + + + + + +What is the difference between print x and print x, + + +30 + + +correct manually + + + + + +What does 't' * 40 produce? + + +30 + + +correct manually + + + + + +What is the output? + + +In []: ', '.join(['a', 'b', 'c']) + + +30 + + +correct manually + + + + + +What is the output? + + +In []: 47 % 3 + + +45 + + +2 + + + + + +How do you find the presence of an element x in the list a + + +30 + + +x in a + + + + + +What is the output + + +In []: set([1, 2, 8, 2, 13, 8, 9]) + + +45 + + +set \( \[ 1 , 2 , 8 , 13 , 9 \] \) +\[ 1 , 2 , 8 , 13 , 9 \] + + + + + +What is the output + + +In []: a = {'a': 1, 'b': 2} +In []: a['a'] = 10 +In []: print a + + +60 + + +\{ \'a\' \: 10 , \'b\' \: 2 \} +\{ \'a\' \: 10 , \"b\" \: 2 \} +\{ \"a\" \: 10 , \"b\" \: 2 \} +\{ \"a\" \: 10 , \'b\' \: 2 \} + + + + + +What is the value of a after executing this code. + + +In []: a = [1, 2, 3] +In []: a.extend([5, 6]) + + +45 + + +\[ 1 , 2 , 3 , 5 , 6 \] + + + + + +What is the output? + + +In []: a = (1, 2, 3) +In []: a[1] = 10 + + +30 + + +error + + + + + +What is the value of func(1) where + + +def func(x, y=10): + print x+1, y+10 + + +60 + + +2 10 +2 , 10 + + + + + +How many items can a function return + + +30 + + +Multiple + + + + diff -r aae2f69ba89c -r 3643f59f141e quiz/management/commands/seed_que.py --- 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