Page 128 - Information_Practice_Fliipbook_Class11
P. 128

Solved Exercises


        A.  Multiple Choice Questions
           1.  WhichloflShtlfoaaowinglifltSnStetnSlitltynSncSicnaaylcorrtcS?
              n.l iflnuebtrl>=10:l     b. Ifl(nuebtrl>=l10)l  c. iflnuebtrl>=l10,lShtnl  d. Iflnuebtrl>=10lShtnl

           2.  WhnSlwiaalbtlShtlouSpuSlproductdlonltxtcuSionloflShtlfoaaowinglcodtltnipptS?
              num1, num2, num3 = 1, 3, 5
              if num1 + num2 + num3:
                  print("if condition holds True")
              else:
                  print("In else clause")
              n.l if condition holds True
              b.l In else clause
              c.l  ynSnxlError
              d.l NolouSpuS

           3.  WhichloflShtlfoaaowinglchnrncStrtlenrktlShtltndloflShtlhtndtrloflnlcoepoundltSnStetnS?
              n.l :                    b. #                   c. *                   d. ;
           4.  WhichloflShtlfoaaowinglitlnoSlnlconSroaltSnStetnS?
              n.l ifltSnStetnSl        l                      b. if-else tSnStetnS
              c.l nttignetnSl          l                      d. if-elif-else tSnStetnS
           5.  WhichloflShtlfoaaowinglitlnlvnaidlktyword?
              n.l IF                   b. if                  c. Elif                d. ELSE
           6.  WhnSlwiaalbtlShtlouSpuSlproductdlonlShtltxtcuSionloflShtlfoaaowinglcodt?
              height = 190
              if height >= 180:
                  print("You cross the bar")
                  print("Good")
              print("Sorry")
              n.l You cross the bar
              b.l Sorry
              c.l You cross the bar
                Good
              d.l You cross the bar
                Good
                Sorry
           7.  WhichloflShtlfoaaowingltSnStetnStlitlnoSlSrut?
              n.l Anlif tSnStetnSleutSlhnvtlnnltattlcanutt.
              b.l An if tSnStetnSlwiShinlnn else baocklforetlnlnttStd if tSnStetnS.
              c.l AnlifltSnStetnSlcnnlhnvtlnnylnuebtrlofleliflcanuttt.
              d.l An ifltSnStetnSlenylnoSlhnvtlnnlelselcanutt.
           8.

               if num < 0:
                   print(num, " is a negative number")
               if num > 0:
                   print(num, " is a positive number")
               else:
                   print(num, " is zero")

          114  Touchpad Informatics Practices-XI
   123   124   125   126   127   128   129   130   131   132   133