5 Mark For Python
5 Mark For Python
2 if.... else
Boolean ecpoussion :
I3 3
|20 60
1
Toue an d Truue
Statem ent
Boolean
expesion Tsue
False
Bleci ot
Blok af Statements
Stutenents
Block of Statements
0f 8tatement!
The i gtatem enk evaluates the þoo lean
Statement
False Boolen
espnton
Tre
| Blocs of btatements
Block of statements
negatve %a)
Q.
Stotenent 1f
bloc -
else :
Blockof else
i4
8taternents oß
statements
Block oß False statement culU
statement
The
btatements
BlockBoololean
i
- be
|Statement | else :
expresion: Stuten
ents ete
exprentoBoolean wilciuted. the
statenent
be elt
otheuse,
executed.
Blouk o Tue is
8tatements evaluates
tue
the the
else block
the
boolean
pwt o
loop!
Condltfon neveniInpinite
wheeh dalnite
Roop false. xample:
Tnlonop
An Output Prént (ie=n)
while :
Ffbonacel
benies # A
n
n= Kknoun the Ininite
So,tenirates Ent a (" fnt(
Depnite in
int numbe the Prant(i)
befo e the ne input
input Swn
bloc the
Noop
a loop teActiye ("Enton
the tmes Itertlon. yalue
( b o s
Please an
escution an statement s"
he
toratRve Btatement a
tonatLive 2Sum) pOs2tive
enten loop That
of to
Stsute etecuted hevenmears,
the 8tuctwe ntegen"J)
the be
nunmbe
esteuted
loop. becomus the
:")) n over
that
fon ? fn ange (i, n-):
nvaue = fvalue+ Bvaue
lvalue= Svale
Svalue= nyalua
Pint (", n nyalue Sep= ende"
")
?
ne
element location. locatfon. aeneral
fuom eisting the heu ist
the t en
ed value ex
al
the the alue opanat?ons
ListThe Ast
lest
o a
S. value 4from
spectgled
veo the
3spetied at ctth
2 opratfon
Delete teAppend cipdate Retxleve 2 I.
element a
Inóert
the elements reate
lst. th SpetlEad
or. loeatfon
locatfon :
lsed
ocatfon. emove
oneist. Ubed -
neco speteol
used - - -
vale used at dt
The Thls
smove to
to to ae s
tocatfon. InftPal
gten Afton tooperatfn
at Locatfon oprtfon wsccl
add moved
the thypdate
e
removingelementan necw tme to
peceec speelflad used toThe CLeate
elament the Tnseet
Sue
elements
to
the cesive empty
at
get a
calling value and utwunng fenction:
Zeto 6 mose etcxn
A furction may Contain
etun Can be sed only when
Natement. The
valu kack to the caller and
eguired to pass
o reton Statment is not Kondatony
Cases, the' caleulated faetosial valus
Th Bome
puwther calatlon fn th cald
yequied for
Progran place
caling vola onod retas'ng ucton
# Factonal wstng
# functfon dinitlon
def fact (ni):
retun (F)
# man module
n = înt (input (" Enten'n'
value:)))
A = fnt (Pnput Enker a'value : )
fact (n?/fact(»)
fact Cn) fact (s) *faet (n-)
Pnt ( Answer Ron npr s:", npr)
Print (" Anbwen fon nc s :",nca)