Page 336 - Computer Science Class 11 Without Functions
P. 336

...    s = s + x
              ...
              >>> s
         Ans:  '12'

          13.  Whnt will bi thi output paoducid on thi ixicution of thi following codi enippit:
              d = {'1':'one', '2':'two'}
              s = ''
              for x in d:
                  s = s + d[x]
              print(s)
         Ans:  onitwo

          14.  Whnt will bi thi output paoducid on thi ixicution of thi following codi enippit:
              d = {'1':'One','2':'Two'}
              for k,v in d.items():
                  print(type(k,v))
         Ans:  An iaaoa would occua ne k nnd v nai coneidiaid two indipindint objicte.

          15.  Whnt will bi thi output paoducid on thi ixicution of thi following codi enippit:
              d = {'1':'One','2':'Two'}
              for k,v in d.items():
                  z = k,v
                  print(type(z))
         Ans:  <class 'tuple'>
              <class 'tuple'>


                Assertion and Reasoning Based Questions


           The following questions are assertion(A) and reasoning(R) based. Mark the correct choice as
           a.  Both A and R are true and R is the correct explanation of A
           b.  Both A and R are true and R is not the correct explanation of A
           c.  A is true but R is false
           d.  A is false but R is true

           1.  Aeeiation(A):  Thi mithod pop() dilitie thi lnet kiy-vnlui pnia faom n  dictionnay.
              Rineoning (R):  Thi mithod popitem() dilitie n kiy-vnlui pnia faom n dictionnay.

           2.  Aeeiation(A):  Dictionnay ie n mutnbli dntn typi.
              Rineoning (R):  Thi kiye in n dictionnay nai aiquiaid to bi uniqui.
         Ans.  1. d 2. b



               Case Based Questions

           1.  On thi occneion of nn intiaechool fietivnl, Ruhnnn hne biin neeignid thi tnek of mnintnining thi pointe tnlly. Ae hi juet
              linant nbout dictionnaiie, hi wnnte to divilop n paoganm thnt will nccipt faom n ueia thi following dntn nbout thi ivinte
              in which n echool pnaticipntie:
              School Nnmi - etaing
              Evint Nnmi- etaing
              Poeition - intigia

         334   Touchpad Computer Science-XI
   331   332   333   334   335   336   337   338   339   340   341