Professional Documents
Culture Documents
Python Programming Lab Work
Python Programming Lab Work
farheinhil to celeius.
’ np inputl"Em tou the Fashenhil Pemperm ture)
ty:
tont tonp)
el Cfah32. o) * 5 /4.0
print cu)
tmpt,
preint ("emtrr a valid tempeontue )
print("o)
D
Prnt ("e")
eli seoHe 5
Prnt ( s )
else:
preint ("p")
betueen - 0 4)
"Py than Pa teen Progvams i
ows =iut (inputlntou no. of uous))
iange (oows ):
print( " , end )
prnt (un)
A
seivalue G5
honge ei41):
alphab et e(asei- valne )
prnt (aphabet, eud ")
aseiivalne t l
d n to
tempn
ns nlto
d n %0
þrit (Amstonqno'
else?
no.")
PHit ( Atet au Amihog
oWE a proqrum to eneek vohthe a qen mumber tmstrong o
not wchin a mit qwen biy the wsee.
wie m> o.
Prnt(num )
Jete apro qram to input
the elements at even location leha the elements at odd locations.
tontmue
an append Cn1)
a. append (m2)
fon
a.append Cn3)
þen-Ca)
e Oni a proqram that tares a cttny wn muiple eooTds
nd Hhen tapitali xes ths kiet uttw eah
eaeh wovd and emas
¬ mpulent a
thing:")
end
t hing (o].uppex l)
a t
tat1]!:):
el (sla]:'adzteug
ee
Aoe i in (bnlst ):
else
n[z1+ 1
ese
nEx]1
elhe
n[z] 1
fore it in n?
print (it,"-", n[ft1)
SHe enputl"entor a shing")
fnequeney str)
4hat etauts
|BPnt the day he ween fomhe ines in me
or line in fhaudi
d[e]
ele
d[e]d[e]+1
prnt (a)
Owtput- d:P:2,:1hi1, o':2, n':1,2,:1,411, m:
dle]:d.et (o,o) t1
preint ld)
utput d:}P:2,y:,t, W:1, o'2, n:1, 1:2,4':1,a:dm:1
eue
coents [wod Counts ordIt1
þrínt (tount)
Looping and Di ettonames ?
12,'Tan 1oo
, ann'e:u2)
Chuek
+rint (K, tounti [K])
uie 42
tounts 3ehuk','ae'42, Jan' t00
þrintPenleet Nteumbere)
elhe
þint lNot a poect itumbut")
n: ent mput ("ntu a nu mbere ")
tenget (n )
" Advonuud Teet Pat son
Tmpo ret steing
tnput
fnand open (-{name)
eeept:
þrint ("iu tannol beop en, nme)
COent dtet()
Ko Line in fnand?
ine o tinethanslate (tie,mate traus
Smdng-puntthetin)
mes tie. loweue)
wortds : tine. optitt)
on oreds
w d ot n cout?
eounts [tword]1
ese?
CoLuts [toore dJt1
prent lLoents)
three numbes.
oLOite aproqram to fnd among
Setn a
ee;
Hetue
41
Teuples
Sppose you hoane a you want tusoret taem fom
togest to shoHUsl.
Hes. append w)
$renl-les)
d:':to,' 30,b:15
dappend (val,TRUE)eay)
tisoret( r e
imporet stting
{hand 6pen (test-tt")
eounts dicte)
fox tine in Buaud:
Aines tine.tuanalato (tunsimaebasl , seing. plncatin))
ee
Val in couns.
Lst. se t(enee-TRUE)
rettum n
ele
num 5
print( Imralid o )
else?
prent(tata'aonum fact(aum))
de!fibenacei (n
setun n
t3
g4