Python Programming Fundamentals
Python Programming Fundamentals
* CondRon and
* Loops ela stalementa
unciorA
OlordHon
Condiion
ard bancking Yetateent
*Used to lontil Hfe fesotorcltonFalse
to
mabe clocaona
sue
Gtain londitionsbasd on
Hlconcditbn)
End
Taue Ex
[Body
b= 2O
4acb:
x- Trte dato ule.
alae:
b90
a BO
Yb>a!
b-5o
b>a: pnt ("bis geater toa
a)
elf a --b:
Patnt (a ard bae ega
Puirt ("a and bare cqual elue:
LoPt next 4
x= 'banana":
Rete a sat gsldervot
as as a Corolison
loninue
taue
Paint (x)
Eotes loop
app/e
Test False
chegy corcliton
Rarge Tsue
Eyoax in Sarge (b):
Oile oP
X=1
6 ohile xc
Bc: fos x in sangel39,) Print ()
Pirto)
20
2
23
26
29 4
Else staement
Bsecalfatenert Run aabocl ol ce cn
Stef +fo lop en +fe
ohile cohen Re lorcliion ho
E
Condition is tue
Ex
ohile x6:
Lohile c6
Print ()
9e-3) : Psint (x)
bzeak
else:
Xt4.
Pxirt ("xia no lorge
Less an 6")
3 1
2
Continue stateret 3
4
ohtle xCb
Xü nologex fecs fhan
t==3: funcons
Corfinue Tt is a bbcks t
Keusable lode tBat eyo
* Funcior uns
itis called
TE Cn he a le
muliple imes
add (5,6)
dy hllo (): Sul (7 3e)
PaiatHe lb oonld
Pint Co t20)
!)
fello
Hello ooxld Pasaretes and augarmeit
3o
Tyfosrna on Can be Prsed
frto funchons as ojurment
ane
Puo -+d (input ("Entes he Auncjon name, îns?de
po;)) tRe psenthesa
4 po-= |234 : dd s nany aygume nt
Paint ("sard hya) you coanh, Just sefueta
Psntl age:21)
Pxint ("Scoecfiee ") ffem oitk a Cmna
else
def Belb Chane)
Ph) Psint ("Hallo' t hame)
Ente thie plo :l234
Grdhya follo ("davad')
SuDeshee
Hello ar
df add Ca, b): Hellb ton
Plnt (atb) H
elo dawtd
odef Sub (a, b):
Psint(a-b)
Rekun ales
Postionml asqument
do geefg (rare 1
Pint(",j raynuned:
megj , Ketan 5
nane2")
rectg ('tom', Jey) Patnt (my-funchen (5))
45
dy reetirg (a,):
gheeting(a s"eoro'", b-yjesy)
Hello torn
Dyfult fauernela Value
I am fronm goden
Trota
Irota
BAazi!