0% found this document useful (0 votes)
8 views

IoT Assignment 3

Uploaded by

Vithoba Pirankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

IoT Assignment 3

Uploaded by

Vithoba Pirankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

elssMAte

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

hody ofi lbodyoele

Stop

(0) statement Exeutesone block theconditons bue


i-ese
and anothe block iiti falke

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

stattment Ext theloop

( bataktattent
Usedto ertt abp pemaktaly
ohen acetauncodtonsmol
elssute
Date
Page

ntethe loop
Test
Corditon

Break Yes

NO

Remaung fode
Extthe oop

(Vi Continue statementiSkip:the set q the cument itoration


and proceeda nwiththe nest itatoy
Agor thelayp

Tue
Kondribn Continve

Sase

block

2-4uncon.to calcidatum o even and odd numbes


|dei sumLoddeven(n)i
Sum_eVey >0
kSum-odd-oL
in sange(1nti)
foxi

Sum-evlnt=|# Add to Sn even |een


else:
Sum-oddtEi
#Rdd Smodd 4 odd
elassmute
Date
Page

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

bacak tt xtthe bop

olp found d mumber be by3'9


divis

N)Contnuestcutement: Dsed to stipthecurrentitehto4


o the loop &ove on meat itesati

Ex: #Pont Bnlyodd num the bst be m

Mum bexs C1,2,3,4,5,65

foy num in Durmbesi


Mum'/ 2==0
Continue #SKips the iteration

paint(f"
odd numbe fnum"
Gutput
1,3,S
olpi

4 Catuhing expections usmy try Beeptstitments


mportant becawse t helpsproent thepugangum
Csashiny wshen an eros OCw
o,Shppng the prvqrum yon can hendle the
Instead
Das and deude sht to do mextJike shanja
meSs age ox tyinganothetcappach.

mport math
delaata(adiu):

sehm)tmath-piTadu1
classmute
Date
Page

(^Entea theraduso
floatGinput ")J
arlei

olp Enteathe Tadui ocYdeis


Astaathne axcde8.533&|6339744g3
Feamet othe oxcle34159
265.3SS9133

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)

You might also like