Page 229 - Computer Science Class 11 With Functions
P. 229

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.  AtttrSion(A):l Inlnlprogrne,lnlttSlofltSnStetnStlenylnoSlbtltxtcuStdltvtnlonct.
                  Rtntoning(R):  InlShtlcnttloflShtlcondiSionnalfaowlofllnlprogrne,lShtltSnStetnStlwiaalbtltxtcuStdlonayliflShtlcondiSionlitl
                              Trut.
               2.  AtttrSion(A):l CondiSionnaltSnStetnStlnndliStrnSivtltSnStetnStlnrtltxnepattloflcoepoundltSnStetnSt.l
                  Rtntoning(R):  CondiSionnaltSnStetnStlnrtltxtcuStdlonaylwhtnlnlpnrSicuanrlcondiSionltptcifitdlinlShtlhtndtrlcanuttlitl
                              tnSitfitd.l
             Ans.  1.ln  2.lb


                   Case Based Questions


               1.  RuhilaikttlenShtlntlnltubjtcS.lNow,lntlthtlitlatnrninglSolprogrnelinlPyShon,lthtlwnnStlSolcrtnStlnlprogrnelinlPyShonlShnSl
                  chtcktlwhtShtrlnlnuebtrlitlnleuaSipatlofl5lorlnoS.l htlhntlwriSStnlShtlfoaaowinglprogrnelbuSliSlitlnoSlgtSSinglShtldttirtdl
                  ouSpuS.lIdtnSifylShtltrrortlShnSlRuhilhntlendtlinlhtrlprogrne.
                  def divisible(n, k):
                      '''
                      Objective: To check divisibility by k
                      Input Parameters:
                         n: Number to be tested for divisibility - numeric value
                         k: divisor - numeric value
                      Return Value: True/ False - boolean value
                      '''


                      if n %5 == 0:
                          return True
                      else:
                          return False


                  number == int(input('Enter a number :  '))
                  result = divisible(number,   5)
                  if result == True:

                      print('Number', number, 'is divisible by 5')
                  else:
                      print('Number', number, 'is not divisible by 5')
             Ans.  • AttignetnSloptrnSorlthouadlbtluttdlinllpanctlofl==.
                  • ThtliflbaocklnndltattlbaocklnrtlnoSlindtnStdlcorrtcSayl





                                                                                          Conditonnal SnStetnSt  227
   224   225   226   227   228   229   230   231   232   233   234