IoT Assignment 3
IoT Assignment 3
NehaNigaly Date
226-€-o34 Page
BrunchEte 3
Assiqnmênt
the
1Contol Ja stattmentin thon detrmine
ordex inwhich the code exeates
4 code
D extcuion
statemerntiAlouwsCondihoral
Stattment
start
Candi honlse
Toue
Stop
when theihcondtion
Aond tio
is to ue
Whtntheia
ifBlock
condhon ishalt
else block
statenent Ibs
-eli-else : condihon
allows multiple
be caecke din
t
clse blackjlone gatrue
alassmate
Date
Paga
Stat
Fuemething
Do
SDMathug
Kdeonda
Do
FweSomelhn
Elseco thi
Stop
andhan Fe
Regeatablocka code ttilea
()shile-laap i
Ente ohleJoop
Test falie
ue Eittheloop
Stattmonts
(Dbxlpisxats
ae asta utne (Kke krt ornge
foreachstem Tast
in seayenim tached
( bataktattent
Usedto ertt abp pemaktaly
ohen acetauncodtonsmol
elssute
Date
Page
ntethe loop
Test
Corditon
Break Yes
NO
Remaung fode
Extthe oop
Tue
Kondribn Continve
Sase
block
eturnSUmeven Sumodd
#UeTinput
( bntetanumbu"))
nE nt(input
etthesums
Sum-een,SUm odd= sumodd- euenCn
#OAPut
paht(f"Som oeen numbes uptoîn3{sumeuen ')
Dutput
Entea a num beu ilo
Surm a ekn num be up to 1030
Surno cdd num beei cupt d0:25
2 Continue and beak stenentscontol
the'øw
q like
loogps ur,
theleox do-whle Then help
manage uhen to exit o8 skipcestaun
ieraDbr
(i)
BraKSttrnentUsed to exitthe loop
imecdatelu
Ex# hndng amumbea dausibkb3ina hct
mum be=Li4,92,5J
fos mom inMubei
-itmum'3==o!
penti:found
imbes by3:Sm3
elssmate
Date
Page
paint(f"
odd numbe fnum"
Gutput
1,3,S
olpi
mport math
delaata(adiu):
sehm)tmath-piTadu1
classmute
Date
Page
(^Entea theraduso
floatGinput ")J
arlei
6 @lappend():
Adde an elentntto the end sqthebst
my-lut=[1,2,3J
mg-hst.append(4)
pantlmy ut)klot
pC1,2s4
6)tendc)i
AddyalelerMont oan itecle
to the
(C45J)
m.fatend
pnht(m)
Dlp1,2,3,
4,52
oinsert0'Iasat
anelement ct aspeanc posfhaa
m=Li,23]
minstr(1,'a)
pnnt(m)
Dlp [1a2,3]
elassmate
Date
Page.
indec):
Rcbm thendtK a tha jxrtawsene qcan
elomert
m=Cl,23,2)
pantCm.index(2))
(e)brtcSortithelist
inasendngorde
m=[3,,2]
m.Sortt)
Cm)
paint
olp C4,2,3]
7Ceateamodude'A madule Simply a lythnle
containing{unctiw,
clarses or yauabler
Ex:(oeatagle mamed wnth gelwing
mymodude.py
#ngmodude-py
dey gaeet Cname)i
Xtum f"Hllo,
{ name'y"
Dse the modua:You potcan &uwe th madue
n another tythonpoan
E
#man.py
importmymadule
mame= input( yous name:")
"fnteu
pont(mymadlagacetínane))
olntea
guu namaJohn
Helo,juhn)