PYTHON CHECKPOINT CHAPTER 3
Whatpoispoapocontrolpostructure?po-poANS--
Apologicalpodesignpothatpocontrolspothepoorderpoinpowhichpoaposetpoofpostatementspoexecut
e
Whatpoispoapodecisionpostructure?po-poANS--
Itpoispoapoprogrampostructurepothatpocanpoexecutepoaposetpoofpostatementspoonlypounderpo
certainpocircumstances.
Whatpoispoaposinglepoalternativepodecisionpostructure?po-poANS--
Apodecisionpostructurepothatpoprovidespoaposinglepoalternativepopathpoofpoexecution.poIfpot
hepo
conditionpothatpoispobeingpotestedpoispotrue,pothepoprogrampotakespothepoalternativepopath.
WhatpoispoapoBooleanpoexpression?po-poANS--
Anpoexpressionpothatpocanpobepoevaluatedpoaspoeitherpotruepoorpofalse
Whatpotypespoofporelationshipspobetweenpovaluespocanpoyoupotestpowithporelationalpooper
ators?po-poANS--
Youpocanpodeterminepowhetherpoonepovaluepoispogreaterpothan,polesspothan,pogreaterpoth
anpo
orpoequalpoto,polesspothanpoorpoequalpoto,poequalpoto,poorponotpoequalpotopoanotherpovalue.
Writepoanpoifpostatementpothatpoassignspo0potopoxpoifpoypoispoequalpotopo20.po-poANS--
ifpoypo==po20:po
poxpo=po0
Writepoanpoifpostatementpothatpoassignspo0.2potopocommissionRatepoifposalespoispogreater
po
thanpoorpoequalpotopo10000.po-poANS--ifposalespo>=po10000:po
pocommissionRatepo=po0.2
Howpodoespoapodualpoalternativepodecisionpostructurepowork?po-poANS--
Apodualpoalternativepodecisionpostructurepohaspotwopopossiblepopathspoofpoexecution;poon
epo
pathpoispotakenpoifpoapoconditionpoispotrue,poandpothepootherpopathpoispotakenpoifpothepocon
ditionpo
ispofalse.
Whatpoispoapocontrolpostructure?po-poANS--
Apologicalpodesignpothatpocontrolspothepoorderpoinpowhichpoaposetpoofpostatementspoexecut
e
Whatpoispoapodecisionpostructure?po-poANS--
Itpoispoapoprogrampostructurepothatpocanpoexecutepoaposetpoofpostatementspoonlypounderpo
certainpocircumstances.
Whatpoispoaposinglepoalternativepodecisionpostructure?po-poANS--
Apodecisionpostructurepothatpoprovidespoaposinglepoalternativepopathpoofpoexecution.poIfpot
hepo
conditionpothatpoispobeingpotestedpoispotrue,pothepoprogrampotakespothepoalternativepopath.
WhatpoispoapoBooleanpoexpression?po-poANS--
Anpoexpressionpothatpocanpobepoevaluatedpoaspoeitherpotruepoorpofalse
Whatpotypespoofporelationshipspobetweenpovaluespocanpoyoupotestpowithporelationalpooper
ators?po-poANS--
Youpocanpodeterminepowhetherpoonepovaluepoispogreaterpothan,polesspothan,pogreaterpoth
anpo
orpoequalpoto,polesspothanpoorpoequalpoto,poequalpoto,poorponotpoequalpotopoanotherpovalue.
Writepoanpoifpostatementpothatpoassignspo0potopoxpoifpoypoispoequalpotopo20.po-poANS--
ifpoypo==po20:po
poxpo=po0
Writepoanpoifpostatementpothatpoassignspo0.2potopocommissionRatepoifposalespoispogreater
po
thanpoorpoequalpotopo10000.po-poANS--ifposalespo>=po10000:po
pocommissionRatepo=po0.2
Howpodoespoapodualpoalternativepodecisionpostructurepowork?po-poANS--
Apodualpoalternativepodecisionpostructurepohaspotwopopossiblepopathspoofpoexecution;poon
epo
pathpoispotakenpoifpoapoconditionpoispotrue,poandpothepootherpopathpoispotakenpoifpothepocon
ditionpo
ispofalse.