Page 129 - Information_Practice_Fliipbook_Class11
P. 129

Assuming ShtlvnautloflShtlvnrinbatlnum Solbtl10linlShtlcodtlnbovtlntlwtaalntlinltnchloflShtlfoaaowinglcodtltnipptStlI,lII,l
                  nndlIII,ldtStreintlwhichloflShtlcodtltnipptStlwiaalproductlShtltnetlouSpuSlonltxtcuSionlntlShtlnbovtlcodtlwiaalproductl
                  onliStltxtcuSion?
                  I.

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

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

                     if num < 0:
                         print(num, " is a negative number")
                         if num > 0:
                               print(num, " is a positive number")
                           else:
                               print(num, " is zero")
                  n.l IIlonay
                  b.l IIlnndlIII
                  c.l Ilonay
                  d.l I,lII,lnndlIII
               9.  WhnSlwiaalbtlShtlouSpuSlproductdlonltxtcuSionloflShtlfoaaowinglcodt?
                 num = 3
                 if (num > 2):
                     num = num * 2
                 if (num > 4):
                     num = 0
                 print(num)
                  n.l 3l                   b. 0l                  c. 6l                 d. Error
              10.  WhnSlwiaalbtlShtlouSpuSlproductdlonlShtltxtcuSionloflShtlfoaaowinglcodt?
                  mass = 0.5
                  itemCount = 10
                  if mass < 2:
                      amount = 1.45
                  if mass >= 2:
                      amount = 1.2
                  total = mass * amount
                  if itemCount > 10:
                      total = total * 0.7
                  print(total)
                  n.l 0.725l               b. 0.5075l             c. 0.6l               d. 0.42l



                                                                                          Conditonnal SnStetnSt  115
   124   125   126   127   128   129   130   131   132   133   134