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

15     else:
              16         scholarship = 'Nil'
              17       elif percentage >= 50 and percentage<75:
              18     if annualIncome < 65000:
              19         scholarship = 4000
              20     else:
              21         scholarship = 3000
              22 elif percentage >= 75:
              23     scholarship = 5000
              24 print('Monthly scholarship:', scholarship)
             nepatlOuSpuS:
             >>> Enter your percentage: 78
             >>> Enter the annual income: 8000
                 Monthly scholarship: 5000
            InlShtltxnepatlgivtnlnbovt,lnnlifltSnStetnSlitlnttStdlintidtlnnoShtrlif/eliflbaock.l o,lShtlnttStdlifltSnStetnSl
            wiaalbtltxtcuStdlonayliflShtlconditonnaltxprtttionloflShtlouStrlif/elifltSnStetnSlyitadtlTrue.lAaalShtltSnStetnStlinl
            nlpnrtcuanrlbaocklnrtlindtnStdlnSlShtltnetlatvta.l



                     1.  Which conditional statement can check for multiple values of a single variable?
                     2.  Name any two operators that are used to join two or more Boolean conditions.




                 Let's Summarise



              Ø l ThtlordtrlofltxtcuSionloflShtltSnStetnStlinlnlprogrnelitlknownlntlShtlfaowloflconSroa.
              Ø l InlttqutnSinalfaow,lShtlprogrnelbtgintlwiShlShtltxtcuSionloflShtlfirtSltSnStetnSlnndlconSinuttlwiShlShtlrttSl
                  oflShtltSnStetnStlinlnlttqutnSinalennntr.
              Ø l InlShtlcnttloflcondiSionnalfaow,lShtltxtcuSionloflShtltSnStetnStldtptndtluponlwhtShtrlShtlcondiSionnal
                  txprtttionlyitadt TruelorlFalse.ll
              Ø l AlcoepoundltSnStetnSlofStnltpnntlttvtrnalaintt.lISlcoepritttlontlorleortlhtndtrlcanutttlnndlontlorleortl
                  ttqutncttlofltSnStetnSt,lcnaatdltuiStt.
                  ¦ l AlhtndtrlcanuttlbtgintlwiShlnlktywordlnndltndtlwiShlnlcoaon.
                  ¦ l AltuiStlenylcoeprittlontlorleortltSnStetnSt.
                  ¦ l ThtltuiSt,lfoaaowinglnlhtndtrlcanutt,lnpptnrtlnSlShtlntxSlatvtaloflindtnSnSion.
              Ø l passltSnStetnSlitlignortdlbylShtlinStrprtStr.
              Ø l Anlif tSnStetnSltxtcuSttlnlttqutnctloflShtltSnStetnS(t)liflShtlcondiSionnaltxprtttionlyitadtl(onltvnaunSion)l
                  True.
              Ø l if-elseltSnStetnSlitluttdlwhtn:
                  ¦ l nlttqutnctlofltSnStetnStlitlSolbtltxtcuStdliflShtlcondiSionnaltxprtttionlyitadtl(onltvnaunSion)lTrue,l
                     nnd
                  ¦ l nnoShtrlttqutnctlofltSnStetnStlitlSolbtltxtcuStdliflShtlcondiSionnaltxprtttionlyitadtl(onltvnaunSion)l
                     False,
              Ø l Anlelif canuttlitluttdlwhtnldifftrtnSlncSiontlnrtlrtquirtdlSolbtlSnktnlbnttdlonldifftrtnSlcondiSiontl(ofStnl
                  difftrtnSlvnauttloflnltingatlconSroalvnrinbat).
              Ø l Anl if/if-else/if-elif-elsel tSnStetnSl itl cnaatdl nttStdl ifl tncaotttl nnoShtrl if/if-else/
                  if-elif-elseltSnStetnS.l




                                                                                          Conditonnal SnStetnSt  191
   188   189   190   191   192   193   194   195   196   197   198