You are on page 1of 14

oWnit a proqam en Pyttaen to eonret a giren temperaturt en

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 )

a seoree yetwveen 8 to 10, amd e


Orite a prooam to Enput
the seoee i outo ane prrnt n eRrtore mes fe the
SOe in beten
telole -
and b ,pre ent the
grade wing the
Seoe Grade Yup iput("entA 2eoH*)
ttone -loatlenp)
A

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)

to ent(inpwtlnente wo.of ouws")


1
tange
13 "Prnt G ,end u)
3

A
seivalue G5

honge ei41):
alphab et e(asei- valne )
prnt (aphabet, eud ")
aseiivalne t l

tows ent Cnputl"ent no s ow")


(rows, o, - 1)
(o,i):

YoWSe imt(input ("ete no. o 0ws"))


(0ws, 0, -)
423
13 to in ngeli, i41):
preene Cend w)
1 preint lmm)
o OHiE a proqram thal uill tare input fom
Hevse it.

inp: int (inputent the numbereu))

d n to

print( ReneHe Nemhere ?" ev)


" LOHie aprogram to fend e sum e

inp eint(nputl"ntor e umbere "))


d np 10

þtint (umel the numbere :"3um)


OHi a program to wheth a mu mbey n þalndrome
hot

tempn

ns nlto

pent ( he mbeu i palendome)


elue
pint( the nembere in not palindoe")
numbere n a toop:
Wie a proram to fend the largest
’ laugest Non
þreint ('Lawqest &:',twgut)
langet)
fo Crevare in [t,5, -, 7%, 79, 68, 91]3
ore Cievae langest :
NonLe
lanqest (trvare
peent(orqet larqest )
o O e a proqam to nd the smallest numbee in a loop
’dmaLst =None
preent ('Smat i ,2 mallesl)
fore revare in [t0, 5, -3, 0, 7s40]:
<Bmast i None 0e Fvare A&nallet
Smalst evare
þrint("Smallesti?,malest)
to eheeK twheth agien noo Amtrong
tinp ént(nput(Mntu a neembere ")

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.

kore nem n 1enqe (tower, upperet):

wie m> o.

Prnt(num )
Jete apro qram to input
the elements at even location leha the elements at odd locations.

{ore amge (eize):


21: append (in t lnpu))

tontmue

Wuite a progra m-to Stoe the iN natusal tet ms

n: int (iuput neu tr he isof nata no.s"))

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

uOrite a proqran hant hLoads email-id a peMson andesues


that it belong to the domain a tha. eeluon,

domaim tha. edu.n'


ledo len doweia)
lma len Cemoai!)
&ub email Tlema-ldo]
domain:

ontains just te coman M )


PtLnt(Juis i invaldenI

print ( TMei cmail td ehes no valld or belongs to towm olaem domain)


ouOHiE apro qram to towt twe equemy
Shing
de Hquenuy (8te):

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

not ne. stautswtta (t0m

rint (wnd [21)


Dutiona as a set of lount -
wored'Pytuon Progvam
d dete

d[e]
ele
d[e]d[e]+1
prnt (a)
Owtput- d:P:2,:1hi1, o':2, n':1,2,:1,411, m:

word =python þooqram


d dic l

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

W e a proqram to cont e oLutaUs


’name inputl"eutor filename
Temt ie
thand open (fnne) Pyten progr ammig
eneupt:
We shotd Know
þriat("Rle eantbe opened ? nam)
euite progra mnin
Conts diet()

Kore toored in wds:


a wo. not in Loets ?

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

þrint Ckeont [kI)


Sorebing Aphaseleally
eoLenta 'euex':, ane':te2, Jan'3100k
tut ileonts

Lt. soretC>aue',n', Jan


þtentllst)

. wite a proqYaa to hee twhete a mo a pengeet moi not

þ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

prcat(qitMhoe (So,vo, 5o)

41
Teuples
Sppose you hoane a you want tusoret taem fom
togest to shoHUsl.

t.append (untwored), wered )

Hes. append w)
$renl-les)

Ontput 'stud ent, 'henilape','acndemy tuei ane', we


cn teremy o vale i

d:':to,' 30,b:15

dappend (val,TRUE)eay)
tisoret( r e

Bukput(s0, 2'), (us,a), (toja')


Lst2.indere
(nar)
cido istta
at the manm
enen The max2, þHnt(
ele
indeelnaxi)) Asti.
)ma2 dmai
sta) mar( max
(ost-1) max max
tat. us cando wiw along iss, dt th
botsumens
h beal tue {om element
maxinum mai oliiplay
tutuee proqramm
aud list two input program
to BHi
al
dict)
dielimay
i:
ele
dei.ims
:C) in ,fore
dinediel
c
e'i360,d'too o, a'woo, utput)
d'4oo b!o6, da'G':
300,
valaes adding to
tom proqram Python
ases dicton twbine.
tent
WHit aproqram print the top to most tommon words o a grv

imporet stting
{hand 6pen (test-tt")
eounts dicte)
fox tine in Buaud:
Aines tine.tuanalato (tunsimaebasl , seing. plncatin))

wbred not in ColLut

ee

Val in couns.

Lst. se t(enee-TRUE)

sore va, y in btll0]


Fontoreial o a Ahumoert -
el< fact():
n

rettum n
ele

num 5

print( Imralid o )

else?
prent(tata'aonum fact(aum))

de!fibenacei (n
setun n

retum (fbonae? (m-t) tfibena' (n-2))

pHnt ( Inratid nunbere ")


preeut (fibonaei Sei es)
fore i in Pionge
0nqe tmum):
þrut(benat (?)) 3

t3

g4

You might also like