{"id":1857,"date":"2021-09-24T11:23:42","date_gmt":"2021-09-24T05:53:42","guid":{"rendered":"https:\/\/cbsepython.in\/?p=1857"},"modified":"2022-01-24T12:19:12","modified_gmt":"2022-01-24T06:49:12","slug":"dictionary-in-python-mcq","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/dictionary-in-python-mcq\/","title":{"rendered":"Dictionary in Python MCQ for class 11-12"},"content":{"rendered":"<h2><span style=\"color: #000000;\">Dictionary in Python MCQ for class 11-12<\/span><\/h2>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>1. In order to store values in terms of key and value we use what core data type<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a) list<\/span><\/p>\n<p><span style=\"color: #000000;\">b) tuple<\/span><\/p>\n<p><span style=\"color: #000000;\">c) class<\/span><\/p>\n<p><span style=\"color: #000000;\">d) dictionary<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d9511193e918065865051' value='69d9511193e918065865051'><input type='hidden' id='bg-show-more-text-69d9511193e918065865051' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d9511193e918065865051' value='Hide Answer'><button id='bg-showmore-action-69d9511193e918065865051' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d9511193e918065865051' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">d) dictionary<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>2. What is the output of the following code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">print(a.setdefault(3))<\/span><\/p>\n<p><span style=\"color: #000000;\">a) {1: \u2018A\u2019, 2: \u2018B\u2019, 3: \u2018C\u2019} c) d)<\/span><\/p>\n<p><span style=\"color: #000000;\">b) C<\/span><\/p>\n<p><span style=\"color: #000000;\">c) {1: 3, 2: 3, 3: 3}<\/span><\/p>\n<p><span style=\"color: #000000;\">d) No method called setdefault() exists for dictionary<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d951119406d4000116463' value='69d951119406d4000116463'><input type='hidden' id='bg-show-more-text-69d951119406d4000116463' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d951119406d4000116463' value='Hide Answer'><button id='bg-showmore-action-69d951119406d4000116463' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d951119406d4000116463' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) C<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>3. Which of the following statements create a dictionary?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a) d = {}<\/span><\/p>\n<p><span style=\"color: #000000;\">b) d = {\u201cjohn\u201d:40, \u201cpeter\u201d:45}<\/span><\/p>\n<p><span style=\"color: #000000;\">c) d = {40:\u201djohn\u201d, 45:\u201dpeter\u201d}<\/span><\/p>\n<p><span style=\"color: #000000;\">d) All of the mentioned<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d951119415a6069761192' value='69d951119415a6069761192'><input type='hidden' id='bg-show-more-text-69d951119415a6069761192' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d951119415a6069761192' value='Hide Answer'><button id='bg-showmore-action-69d951119415a6069761192' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d951119415a6069761192' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">d) All of the mentioned<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>4. Read the code shown below carefully and pick out the keys?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">d = {&#8220;john&#8221;:40, &#8220;peter&#8221;:45}<\/span><\/p>\n<p><span style=\"color: #000000;\">a) \u201cjohn\u201d, 40, 45, and \u201cpeter\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\">b) \u201cjohn\u201d and \u201cpeter\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\">c) 40 and 45<\/span><\/p>\n<p><span style=\"color: #000000;\">d) d = (40:\u201djohn\u201d, 45:\u201dpeter\u201d)<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111941ff8095184914' value='69d95111941ff8095184914'><input type='hidden' id='bg-show-more-text-69d95111941ff8095184914' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111941ff8095184914' value='Hide Answer'><button id='bg-showmore-action-69d95111941ff8095184914' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111941ff8095184914' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) \u201cjohn\u201d and \u201cpeter\u201d<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>5. What will be the output?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">d = {&#8220;john&#8221;:40, &#8220;peter&#8221;:45}<\/span><\/p>\n<p><span style=\"color: #000000;\">&#8220;john&#8221; in d<\/span><\/p>\n<p><span style=\"color: #000000;\">a) True<\/span><\/p>\n<p><span style=\"color: #000000;\">b) False<\/span><\/p>\n<p><span style=\"color: #000000;\">c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Error<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111942997099157944' value='69d95111942997099157944'><input type='hidden' id='bg-show-more-text-69d95111942997099157944' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111942997099157944' value='Hide Answer'><button id='bg-showmore-action-69d95111942997099157944' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111942997099157944' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) True<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>6. What will be the output?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">d1 = {&#8220;john&#8221;:40, &#8220;peter&#8221;:45}<\/span><\/p>\n<p><span style=\"color: #000000;\">d2 = {&#8220;john&#8221;:466, &#8220;peter&#8221;:45}<\/span><\/p>\n<p><span style=\"color: #000000;\">d1 == d2<\/span><\/p>\n<p><span style=\"color: #000000;\">a) True<\/span><\/p>\n<p><span style=\"color: #000000;\">b) False<\/span><\/p>\n<p><span style=\"color: #000000;\">c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Error<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111943313070793380' value='69d95111943313070793380'><input type='hidden' id='bg-show-more-text-69d95111943313070793380' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111943313070793380' value='Hide Answer'><button id='bg-showmore-action-69d95111943313070793380' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111943313070793380' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) False<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>7. What will be the output?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">d1 = {&#8220;john&#8221;:40, &#8220;peter&#8221;:45}<\/span><\/p>\n<p><span style=\"color: #000000;\">d2 = {&#8220;john&#8221;:466, &#8220;peter&#8221;:45}<\/span><\/p>\n<p><span style=\"color: #000000;\">d1 &gt; d2<\/span><\/p>\n<p><span style=\"color: #000000;\">a) True<\/span><\/p>\n<p><span style=\"color: #000000;\">b) False<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Error<\/span><\/p>\n<p><span style=\"color: #000000;\">d) None<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111943c71099584609' value='69d95111943c71099584609'><input type='hidden' id='bg-show-more-text-69d95111943c71099584609' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111943c71099584609' value='Hide Answer'><button id='bg-showmore-action-69d95111943c71099584609' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111943c71099584609' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">c) Error<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>8. What is the output? d = {&#8220;john&#8221;:40, &#8220;peter&#8221;:45}<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">d[&#8220;john&#8221;]<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 40<\/span><\/p>\n<p><span style=\"color: #000000;\">b) 45<\/span><\/p>\n<p><span style=\"color: #000000;\">c) \u201cjohn\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\">d) \u201cpeter\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d951119445a1082254042' value='69d951119445a1082254042'><input type='hidden' id='bg-show-more-text-69d951119445a1082254042' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d951119445a1082254042' value='Hide Answer'><button id='bg-showmore-action-69d951119445a1082254042' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d951119445a1082254042' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) 40<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>9. Suppose d = {\u201cjohn\u201d:40, \u201cpeter\u201d:45}, to delete the entry for \u201cjohn\u201d what command do we use:<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a) d.delete(\u201cjohn\u201d:40)<\/span><\/p>\n<p><span style=\"color: #000000;\">b) d.delete(\u201cjohn\u201d)<\/span><\/p>\n<p><span style=\"color: #000000;\">c) del d[\u201cjohn\u201d]<\/span><\/p>\n<p><span style=\"color: #000000;\">d) del d(\u201cjohn\u201d:40)<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111944eb4077249067' value='69d95111944eb4077249067'><input type='hidden' id='bg-show-more-text-69d95111944eb4077249067' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111944eb4077249067' value='Hide Answer'><button id='bg-showmore-action-69d95111944eb4077249067' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111944eb4077249067' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">c) del d[\u201cjohn\u201d]<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>10. Suppose d = {\u201cjohn\u201d:40, \u201cpeter\u201d:45}. To obtain the number of entries in dictionary which command do we use?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a) d.size()<\/span><\/p>\n<p><span style=\"color: #000000;\">b) len<\/span><\/p>\n<p><span style=\"color: #000000;\">c) size<\/span><\/p>\n<p><span style=\"color: #000000;\">d) d.len()<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d951119458a4030897518' value='69d951119458a4030897518'><input type='hidden' id='bg-show-more-text-69d951119458a4030897518' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d951119458a4030897518' value='Hide Answer'><button id='bg-showmore-action-69d951119458a4030897518' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d951119458a4030897518' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) len<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>11. What will be the output?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">d = {&#8220;john&#8221;:40, &#8220;peter&#8221;:45}<\/span><\/p>\n<p><span style=\"color: #000000;\">print(list(d.keys()))<\/span><\/p>\n<p><span style=\"color: #000000;\">a) [\u201cjohn\u201d, \u201cpeter\u201d]<\/span><\/p>\n<p><span style=\"color: #000000;\">b) [\u201cjohn\u201d:40, \u201cpeter\u201d:45]<\/span><\/p>\n<p><span style=\"color: #000000;\">c) (\u201cjohn\u201d, \u201cpeter\u201d)<\/span><\/p>\n<p><span style=\"color: #000000;\">d) (\u201cjohn\u201d:40, \u201cpeter\u201d:45)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d951119461f5089502559' value='69d951119461f5089502559'><input type='hidden' id='bg-show-more-text-69d951119461f5089502559' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d951119461f5089502559' value='Hide Answer'><button id='bg-showmore-action-69d951119461f5089502559' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d951119461f5089502559' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) [\u201cjohn\u201d, \u201cpeter\u201d]<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>12. Which of the following is correct with respect to above Python code? d = {&#8220;a\u201d:3 ,\u201db\u201d: 7}<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">print(list(d.keys()))<\/span><\/p>\n<p><span style=\"color: #000000;\">a) a dictionary d is created.<\/span><\/p>\n<p><span style=\"color: #000000;\">b) a and b are the keys of dictionary d.<\/span><\/p>\n<p><span style=\"color: #000000;\">c) 3 and 7 are the values of dictionary d<\/span><\/p>\n<p><span style=\"color: #000000;\">d) All of the above.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111946e02089791374' value='69d95111946e02089791374'><input type='hidden' id='bg-show-more-text-69d95111946e02089791374' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111946e02089791374' value='Hide Answer'><button id='bg-showmore-action-69d95111946e02089791374' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111946e02089791374' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">d) All of the above.<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>13. Which one of the following is correct?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a) In python, a dictionary can have two same keys with different values.<\/span><\/p>\n<p><span style=\"color: #000000;\">b) In python, a dictionary can have two same values with different keys<\/span><\/p>\n<p><span style=\"color: #000000;\">c) In python, a dictionary can have two same keys or same values but cannot have two same key-value pair<\/span><\/p>\n<p><span style=\"color: #000000;\">d) In python, a dictionary can neither have two same keys nor two same values.<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111947776041333565' value='69d95111947776041333565'><input type='hidden' id='bg-show-more-text-69d95111947776041333565' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111947776041333565' value='Hide Answer'><button id='bg-showmore-action-69d95111947776041333565' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111947776041333565' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) In python, a dictionary can have two same values with different keys.<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>14. What will be the output of above Python code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">d1={&#8220;abc&#8221;:5,&#8221;def&#8221;:6,&#8221;ghi&#8221;:7}<\/span><\/p>\n<p><span style=\"color: #000000;\">print(d1[0])<\/span><\/p>\n<p><span style=\"color: #000000;\">a) abc<\/span><\/p>\n<p><span style=\"color: #000000;\">b) 5<\/span><\/p>\n<p><span style=\"color: #000000;\">c) {&#8220;abc&#8221;:5}<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Error<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111948081049096333' value='69d95111948081049096333'><input type='hidden' id='bg-show-more-text-69d95111948081049096333' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111948081049096333' value='Hide Answer'><button id='bg-showmore-action-69d95111948081049096333' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111948081049096333' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">d) Error<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>15. What will the below Python code do?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">dict={&#8220;Phy&#8221;:94,&#8221;Che&#8221;:70,&#8221;Bio&#8221;:82,&#8221;Eng&#8221;:95}<\/span><\/p>\n<p><span style=\"color: #000000;\">dict.update({&#8220;Che&#8221;:72,&#8221;Bio&#8221;:80})<\/span><\/p>\n<p><span style=\"color: #000000;\">a) It will create new dictionary as dict={&#8220;Che&#8221;:72,&#8221;Bio&#8221;:80} and old dict will be deleted.<\/span><\/p>\n<p><span style=\"color: #000000;\">b) It will throw an error as dictionary cannot be updated.<\/span><\/p>\n<p><span style=\"color: #000000;\">c) It will simply update the dictionary as dict={&#8220;Phy&#8221;:94,&#8221;Che&#8221;:72,&#8221;Bio&#8221;:80,&#8221;Eng&#8221;:95}<\/span><\/p>\n<p><span style=\"color: #000000;\">d) It will not throw any error but it will not do any changes in dict<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111948994028375190' value='69d95111948994028375190'><input type='hidden' id='bg-show-more-text-69d95111948994028375190' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111948994028375190' value='Hide Answer'><button id='bg-showmore-action-69d95111948994028375190' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111948994028375190' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">c) It will simply update the dictionary as dict={&#8220;Phy&#8221;:94,&#8221;Che&#8221;:72,&#8221;Bio&#8221;:80,&#8221;Eng&#8221;:95}<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>16. What will be the output of above Python code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">d1={&#8220;abc&#8221;:5,&#8221;def&#8221;:6,&#8221;ghi&#8221;:7}<\/span><\/p>\n<p><span style=\"color: #000000;\">print(d1[0])<\/span><\/p>\n<p><span style=\"color: #000000;\">a) abc<\/span><\/p>\n<p><span style=\"color: #000000;\">b) 5<\/span><\/p>\n<p><span style=\"color: #000000;\">c) {&#8220;abc&#8221;:5}<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Error<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111949348030218750' value='69d95111949348030218750'><input type='hidden' id='bg-show-more-text-69d95111949348030218750' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111949348030218750' value='Hide Answer'><button id='bg-showmore-action-69d95111949348030218750' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111949348030218750' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">d) Error<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>17. Which of the following will delete key_value pair for key=&#8221;tiger&#8221; in dictionary?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">dic={&#8220;lion&#8221;:&#8221;wild&#8221;, &#8220;tiger&#8221;:&#8221;wild&#8221;, &#8220;cat&#8221;:&#8221;domestic&#8221;, &#8220;dog&#8221;:&#8221;domestic&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">a) del dic[&#8220;tiger&#8221;]<\/span><\/p>\n<p><span style=\"color: #000000;\">b) dic[&#8220;tiger&#8221;].delete()<\/span><\/p>\n<p><span style=\"color: #000000;\">c) delete(dic.[&#8220;tiger&#8221;])<\/span><\/p>\n<p><span style=\"color: #000000;\">d) del(dic.[&#8220;tiger&#8221;])<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111949c40075060750' value='69d95111949c40075060750'><input type='hidden' id='bg-show-more-text-69d95111949c40075060750' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111949c40075060750' value='Hide Answer'><button id='bg-showmore-action-69d95111949c40075060750' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111949c40075060750' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) del dic[&#8220;tiger&#8221;]<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>18. Which of the following will give error?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Suppose dict1={&#8220;a&#8221;:1,&#8221;b&#8221;:2,&#8221;c&#8221;:3}<\/span><\/p>\n<p><span style=\"color: #000000;\">a) print(len(dict1))<\/span><\/p>\n<p><span style=\"color: #000000;\">b) print(dict1.get(&#8220;b&#8221;))<\/span><\/p>\n<p><span style=\"color: #000000;\">c) dict1[&#8220;a&#8221;]=5<\/span><\/p>\n<p><span style=\"color: #000000;\">d) None of these.<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d9511194a5e9073836887' value='69d9511194a5e9073836887'><input type='hidden' id='bg-show-more-text-69d9511194a5e9073836887' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d9511194a5e9073836887' value='Hide Answer'><button id='bg-showmore-action-69d9511194a5e9073836887' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d9511194a5e9073836887' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">d) None of these.<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>19.\u00a0Which of the following Python codes will give same output if<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(i) dict.pop(&#8220;book&#8221;)<\/span><\/p>\n<p><span style=\"color: #000000;\">(ii) del dict[&#8220;book&#8221;]<\/span><\/p>\n<p><span style=\"color: #000000;\">(iii) dict.update({&#8220;diary&#8221;:1,&#8221;novel&#8221;:5})<\/span><\/p>\n<p><span style=\"color: #000000;\">dict={&#8220;diary&#8221;:1,&#8221;book&#8221;:3,&#8221;novel&#8221;:5}<\/span><\/p>\n<p><span style=\"color: #000000;\">a) i, ii, iii<\/span><\/p>\n<p><span style=\"color: #000000;\">b) i, ii<\/span><\/p>\n<p><span style=\"color: #000000;\">c) i, iii<\/span><\/p>\n<p><span style=\"color: #000000;\">d) ii, iii<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d9511194b1d7068435736' value='69d9511194b1d7068435736'><input type='hidden' id='bg-show-more-text-69d9511194b1d7068435736' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d9511194b1d7068435736' value='Hide Answer'><button id='bg-showmore-action-69d9511194b1d7068435736' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d9511194b1d7068435736' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) i, ii<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>20. Keys of the dictionary must be :<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a) Similar<\/span><\/p>\n<p><span style=\"color: #000000;\">b) Unique<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Can be similar or unique<\/span><\/p>\n<p><span style=\"color: #000000;\">d) All of these<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d9511194c1e5000049898' value='69d9511194c1e5000049898'><input type='hidden' id='bg-show-more-text-69d9511194c1e5000049898' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d9511194c1e5000049898' value='Hide Answer'><button id='bg-showmore-action-69d9511194c1e5000049898' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d9511194c1e5000049898' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) Unique<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>21. Which of these about a dictionary is false?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a) The values of a dictionary can be accessed using keys<\/span><\/p>\n<p><span style=\"color: #000000;\">b) The keys of a dictionary can be accessed using values<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Dictionaries aren\u2019t ordered<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Dictionaries are mutable<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d9511194d1d9063683042' value='69d9511194d1d9063683042'><input type='hidden' id='bg-show-more-text-69d9511194d1d9063683042' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d9511194d1d9063683042' value='Hide Answer'><button id='bg-showmore-action-69d9511194d1d9063683042' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d9511194d1d9063683042' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) The keys of a dictionary can be accessed using values<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>22. Which of the following is not a declaration of the dictionary?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a) {1: \u2018A\u2019, 2: \u2018B\u2019}<\/span><\/p>\n<p><span style=\"color: #000000;\">b) dict([[1,\u201dA\u201d],[2,\u201dB\u201d]])<\/span><\/p>\n<p><span style=\"color: #000000;\">c) {1,\u201dA\u201d,2\u201dB\u201d}<\/span><\/p>\n<p><span style=\"color: #000000;\">d) { }<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d9511194e087004796208' value='69d9511194e087004796208'><input type='hidden' id='bg-show-more-text-69d9511194e087004796208' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d9511194e087004796208' value='Hide Answer'><button id='bg-showmore-action-69d9511194e087004796208' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d9511194e087004796208' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">c) {1,\u201dA\u201d,2\u201dB\u201d}<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>23. What will be the output of the following Python code snippet?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">print(a.get(1,4))<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 1<\/span><\/p>\n<p><span style=\"color: #000000;\">b) A<\/span><\/p>\n<p><span style=\"color: #000000;\">c) 4<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Invalid syntax for get method<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d9511194ef58011467975' value='69d9511194ef58011467975'><input type='hidden' id='bg-show-more-text-69d9511194ef58011467975' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d9511194ef58011467975' value='Hide Answer'><button id='bg-showmore-action-69d9511194ef58011467975' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d9511194ef58011467975' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) A<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>24. What will be the output of the following Python code snippet?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">print(a.get(5,4))<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 1<\/span><\/p>\n<p><span style=\"color: #000000;\">b) A<\/span><\/p>\n<p><span style=\"color: #000000;\">c) 4<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Invalid syntax for get method<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111950665091759670' value='69d95111950665091759670'><input type='hidden' id='bg-show-more-text-69d95111950665091759670' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111950665091759670' value='Hide Answer'><button id='bg-showmore-action-69d95111950665091759670' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111950665091759670' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">c) 4<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>25. What will be the output of the following Python code snippet?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">a.setdefault(4,&#8221;D&#8221;)<\/span><\/p>\n<p><span style=\"color: #000000;\">print(a)<\/span><\/p>\n<p><span style=\"color: #000000;\">a) {1: \u2018A\u2019, 2: \u2018B\u2019, 3: \u2018C\u2019, 4: \u2018D\u2019}<\/span><\/p>\n<p><span style=\"color: #000000;\">b) None<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Error<\/span><\/p>\n<p><span style=\"color: #000000;\">d) [1,3,6,10]<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111951015099930055' value='69d95111951015099930055'><input type='hidden' id='bg-show-more-text-69d95111951015099930055' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111951015099930055' value='Hide Answer'><button id='bg-showmore-action-69d95111951015099930055' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111951015099930055' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) {1: \u2018A\u2019, 2: \u2018B\u2019, 3: \u2018C\u2019, 4: \u2018D\u2019}<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>26. What will be the output of the following Python code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">b=a.copy()<\/span><\/p>\n<p><span style=\"color: #000000;\">b[2]=&#8221;D&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">print(a)<\/span><\/p>\n<p><span style=\"color: #000000;\">a) Error, copy() method doesn\u2019t exist for dictionaries<\/span><\/p>\n<p><span style=\"color: #000000;\">b) {1: \u2018A\u2019, 2: \u2018B\u2019, 3: \u2018C\u2019}<\/span><\/p>\n<p><span style=\"color: #000000;\">c) {1: \u2018A\u2019, 2: \u2018D\u2019, 3: \u2018C\u2019}<\/span><\/p>\n<p><span style=\"color: #000000;\">d) \u201cNone\u201d is printed<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111951938045793999' value='69d95111951938045793999'><input type='hidden' id='bg-show-more-text-69d95111951938045793999' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111951938045793999' value='Hide Answer'><button id='bg-showmore-action-69d95111951938045793999' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111951938045793999' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) {1: \u2018A\u2019, 2: \u2018B\u2019, 3: \u2018C\u2019}<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>27. What will be the output of the following Python code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">a.clear()<\/span><\/p>\n<p><span style=\"color: #000000;\">print(a)<\/span><\/p>\n<p><span style=\"color: #000000;\">a) None<\/span><\/p>\n<p><span style=\"color: #000000;\">b) { None:None, None:None, None:None}<\/span><\/p>\n<p><span style=\"color: #000000;\">c) {1:None, 2:None, 3:None}<\/span><\/p>\n<p><span style=\"color: #000000;\">d) { }<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111952258060562272' value='69d95111952258060562272'><input type='hidden' id='bg-show-more-text-69d95111952258060562272' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111952258060562272' value='Hide Answer'><button id='bg-showmore-action-69d95111952258060562272' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111952258060562272' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">d) { }<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>28. What will be the output of the following Python code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:5,2:3,3:4}<\/span><\/p>\n<p><span style=\"color: #000000;\">a.pop(3)<\/span><\/p>\n<p><span style=\"color: #000000;\">print(a)<\/span><\/p>\n<p><span style=\"color: #000000;\">a) {1: 5}<\/span><\/p>\n<p><span style=\"color: #000000;\">b) {1: 5, 2: 3}<\/span><\/p>\n<p><span style=\"color: #000000;\">c) Error, syntax error for pop() method<\/span><\/p>\n<p><span style=\"color: #000000;\">d) {1: 5, 3: 4}<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111952b66033115173' value='69d95111952b66033115173'><input type='hidden' id='bg-show-more-text-69d95111952b66033115173' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111952b66033115173' value='Hide Answer'><button id='bg-showmore-action-69d95111952b66033115173' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111952b66033115173' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">b) {1: 5, 2: 3}<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>29. What will be the output of the following Python code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">for i in a:<\/span><\/p>\n<p><span style=\"color: #000000;\">print(i,end=&#8221; &#8220;)<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 1 2 3<\/span><\/p>\n<p><span style=\"color: #000000;\">b) \u2018A\u2019 \u2018B\u2019 \u2018C\u2019<\/span><\/p>\n<p><span style=\"color: #000000;\">c) 1 \u2018A\u2019 2 \u2018B\u2019 3 \u2018C\u2019<\/span><\/p>\n<p><span style=\"color: #000000;\">d) Error, it should be: for i in a.items():<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111953478007419513' value='69d95111953478007419513'><input type='hidden' id='bg-show-more-text-69d95111953478007419513' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111953478007419513' value='Hide Answer'><button id='bg-showmore-action-69d95111953478007419513' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111953478007419513' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) 1 2 3<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>30. What will be the output of the following Python code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">&gt;&gt;&gt; a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">&gt;&gt;&gt; a.items()<\/span><\/p>\n<p><span style=\"color: #000000;\">a) Syntax error<\/span><\/p>\n<p><span style=\"color: #000000;\">b) dict_items([(\u2018A\u2019), (\u2018B\u2019), (\u2018C\u2019)])<\/span><\/p>\n<p><span style=\"color: #000000;\">c) dict_items([(1,2,3)])<\/span><\/p>\n<p><span style=\"color: #000000;\">d) dict_items([(1, \u2018A\u2019), (2, \u2018B\u2019), (3, \u2018C\u2019)])<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111953d68048102496' value='69d95111953d68048102496'><input type='hidden' id='bg-show-more-text-69d95111953d68048102496' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111953d68048102496' value='Hide Answer'><button id='bg-showmore-action-69d95111953d68048102496' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111953d68048102496' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">d) dict_items([(1, \u2018A\u2019), (2, \u2018B\u2019), (3, \u2018C\u2019)])<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>31. What is the output of the following code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">for i,j in a.items():<\/span><\/p>\n<p><span style=\"color: #000000;\">print(i,j,end=&#8221; &#8220;)<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 1 A 2 B 3 C<\/span><\/p>\n<p><span style=\"color: #000000;\">b) 1 2 3<\/span><\/p>\n<p><span style=\"color: #000000;\">c) A B C<\/span><\/p>\n<p><span style=\"color: #000000;\">d) 1:\u201dA\u201d 2:\u201dB\u201d 3:\u201dC\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111954730088710848' value='69d95111954730088710848'><input type='hidden' id='bg-show-more-text-69d95111954730088710848' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111954730088710848' value='Hide Answer'><button id='bg-showmore-action-69d95111954730088710848' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111954730088710848' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) 1 A 2 B 3 C<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\"><strong>32. What is the output of the following code?<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;}<\/span><\/p>\n<p><span style=\"color: #000000;\">for i,j in a.items():<\/span><\/p>\n<p><span style=\"color: #000000;\">print(i,j,end=&#8221; &#8220;)<\/span><\/p>\n<p><span style=\"color: #000000;\">a) 1 A 2 B 3 C<\/span><\/p>\n<p><span style=\"color: #000000;\">b) 1 2 3<\/span><\/p>\n<p><span style=\"color: #000000;\">c) A B C<\/span><\/p>\n<p><span style=\"color: #000000;\">d) 1:\u201dA\u201d 2:\u201dB\u201d 3:\u201dC\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\"><input type='hidden' bg_collapse_expand='69d95111955044003431631' value='69d95111955044003431631'><input type='hidden' id='bg-show-more-text-69d95111955044003431631' value='Show Answer'><input type='hidden' id='bg-show-less-text-69d95111955044003431631' value='Hide Answer'><button id='bg-showmore-action-69d95111955044003431631' class='bg-showmore-plg-button bg-orange-button bg-arrow '   style=\" color:#4a4949;\">Show Answer<\/button><div id='bg-showmore-hidden-69d95111955044003431631' ><\/span><\/p>\n<p><strong><span style=\"color: #000000\">a) 1 A 2 B 3 C<\/span><\/strong><\/p>\n<p><span style=\"color: #000000\">\u00a0<\/div><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dictionary in Python MCQ for class 11-12 &nbsp; 1. In order to store values in terms of key and value we use what core data type a) list b) tuple c) class d) dictionary &nbsp; &nbsp; 2. What is the output of the following code? a={1:&#8221;A&#8221;,2:&#8221;B&#8221;,3:&#8221;C&#8221;} print(a.setdefault(3)) a) {1: \u2018A\u2019, 2: \u2018B\u2019, 3: \u2018C\u2019} c) [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,20],"tags":[],"class_list":["post-1857","post","type-post","status-publish","format-standard","hentry","category-cbse-sample-papers-class-11","category-cbse-computer-science-with-python-class-12"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/1857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/comments?post=1857"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/1857\/revisions"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=1857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=1857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=1857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}