Conditional Statements in Python:
Conditional statements in Python are used to execute
certain blocks of code based on specific conditions.
These statements help control the flow of a program,
making it behave differently in different situations.
A_ belp pavdiculay tode
Jonly ohen a cexlain eondiHion is mel x but
ARf only has. ONe candidion to check Solislia
Condilion
false
Con ditio nal Code
penkraft
Date:
Page No.:
|Depicion of slalemen
h dhe fallazaigj cade cxanple. ue'se
Hhe if condilign, e.a U;f amodulo 2 equcals ta o
ehaching
Hhen the pxio slatemerd ilL exeule
n=lo
piO o is an eVen humbey"
Jhe -else sloemeod evauales dhe
candilion and ull exeLode the bady af ff L he
Hest conddion fs ue . burd f he condiion îs false
Hhen dhe bady of else is execuled
condidiop
hue
else body
iF body
Date:
Page No.:
Depicsian o L-else slalement
Tn dhe allauwing tade exomple he else
body aill ezecute as.
lequal too
print (ois even')
NesBed £3
staement inside onathey9f sBatement
folse
Condition !
Tue else body
False
conditi on
2
else body ITue
iF body
penkraft
bci
biq" isvalue (a pxiatelseprin
b=la
beexeiNR1han
TE c
saxeaderyesdhen
if han Axeadex also
ke thatCondidian onadhey
E we'ue hen
T bhon Aeadey condiion the iEigst
In
se con ,we example Cade allozoigg
slalemet nesded DepicRon
o!
No.: Page
Date: