0 ratings0% found this document useful (0 votes) 25 views35 pagesComputer ? Record 1st Sum Python
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Payson te Conver the given fempondun “Faun
Fahweltt Costu vice Vera Deperding “pan
wrens _clwice
% wa a flan pg am Hel Converts the temperde
© pabeallt el Aue acl on the wens Chavice »
Algaxitham He
1. Stord
L paaplay options ™ Ppgvide the wien usith tuo eytfons = Conved
nom Fadnenlit 40 Ghsivs on Ghiw do fabounlit,
B.Tnpud the clcte + Take Prqudt Fam tle wes Fox hon
psuitera tonyertion choice «
cInyad the fempenatue !- Depordig on thr chee , pron
te user to vm the tempest Un Falun om
cebiw.
is + Copnesion Fotos.
> Te Comet Fam Folombil be Celsius»
C= URBAD X SAL SVFooe PCE ~ 32) times 9F £45
C=9CF- 30) x8
7 To Comet Joe Guus 4s tana
Fe Crafton = \4nwe Le Has ScJa aoe 5E x43
* Paidyern tv Comation } Rael on te wou
Chale, aprby tia appsipudat: Fuinula te
Gorved — the tempercilune ,
ae cm gy
PG DEPARTMENT OF COMMERCE (CA) Government Arts College, Dharmapuri- ‘converting Fabsuinkitt bo Cobias ard
Othe Fon Convertir Ghiws tb Fabel
> Depending on te users Jingu, tee eee
Conversion us pertoamed using ths + pPeepeide
Formula.
=» The seut ws then dispayed to te wher.5 Ex. No.
Date =
Raoult‘
Ths bes Pop te corverd us given
erm ponatuns “stom fabsenit tp Qliw ard vtee
Deperding upon werd clrotes MW Excocuted
Success Ful,
Io
,
‘ofsie a pyflen pangonm 4 cotta 3h
Lhe FoUlswing preter , wig 2 rote loop
a uvib 0 Pythen poop — Bot tems
Apocitte. pattern wig rostad lewpt . ThE pattem wil
be pysounid Uke , whew cach gt covdaims @ Canton
ber 1 stow CM), ant ths raurobor St Hans round
ths sus psog nn:
Algasithar “
\. Stat
©. Tiétalize a Vosrtiobls sto te the dlpained rumoe
GF wows Leg. 5).
3. Joop though gach so [outer lop):
> For cach too t Catorting aor 4), priv
Apoces and land.
A. Poi Apaced ',
=> Canale a Chop Cinna Lrop’) thal wns
oy, to Abit
Faom \toi, party stow cl™
AHS — foward «fs anten.
» Pind Ata:
another — |p Linn» loop pred
=> Caoae
sums doom 1 407 , ponds, Aton Ove "S45
a
7 0,PG DEPARTMENT OF COMMERCE (CA)
Otten Podntting tes Atos
go , part & spaas ovr | Aron,
und, pode 3 Apouts ood 2 Aon
und» pair 2 Apacee and 3 shows
sw , pid | apaces and A Aton .
nwo, pated no feos are 5 hos,
Yor lat m0 ds pdrted
Government Arts College, Dharmapurl - 5“Thus tha Python. psoytare te Comabiuncl Hs
loop QP ExecutedPacqame fo rleukt dal rites, pocontoge and
age a ‘ree obtalnsd tn gach tho Fhe subjede ont
eas é sheds of
Fame pearsye Mt dam urligte Me, Sa
Obkainad in The surfs . The wor vill dng
sr ryakes on cach ubged » The wer will mgd be
ks Fon ach Audjed » ard tie program wl compile
‘stad, poveniags and grede according fo ths toowing.
epodig cattbaio!
| Goode A * Peendige > G0
=> Goode & ! Penondaye > “1? ard 2 ¢0
=r Gwode ¢ > Pencontage } bo ard 2710
> Gade p | Pereadge + hd ard 260
s Goode € ! Pencordege Lh,
Algcoritham |
1. Stood
9. Tnpuk — qroxks !
> Poomph — te sen do ral bn coats
btetnal in cach ot he Five Aadfad
m Sint tue moths Sn yeu io
Vt on “fuathan caletabtons
Oayo
>
20
Explanation | The paopram nods ths rosie “tom
ent Aubjes pubith te wer will provide — tyrouyh |
Kaybend dnp, Hye individual Urphs wi) be
Collected .
3. lauldte Told mors t
2 Sum te yoke 6t all Fhe Aubjeds by
the fotel masks.
=> Fexmula } Teta) Makes 2 masks [4 mostk > 24 monks |
Bt marks Wt wrosike 6 \tet S Total monkesG= (fet
Srreakst} + \port Srths.s4 + \ dot Sanka \tedt
Praksay A \ted Srotkss% Toto Monkes = monks | + |
Maikod 2 4 mankes 3+ rontkes'4 + moka 5 |
Explanalin + Thu tole) rvankes ove obhnal by alg the |
Alon 6& oll the Aulyeds « Ths gives ths oneal
Jroa wh & 500 Castuming eoch subject bos a
maxim Aco ot (039,
A: Galasdade Percorbage :
=> Use We fotal rrorts te Calelide ths peranton
by dividing the deta! wostks by ths ai mun
poxible marks C50) ard mubplayive by I,of
se Foxmullat Pexcortoge = Cala) jronkes 500) x 1bo \ text
fPeronbye§ © \ feat C\ Troe 8 \ted Stated mostkes’y
Comes \ yt) \irnes [bo Percentage =(500 Total Moslees)|
Explanalio! The pereardoye 4 taleuadel by dniding,
tas doled maxks by dia otal maximum poste mote
($00 Un this cased ard Converttva, i nv a pencenhage
by rmulltplauying by 1:
5. Determine Guede ! :
>» Base om the talubted parvontoge » A ctermine te ete
wire, the Folia tondtdions:
-+ TH pertentage 7 Bo , assign Goode A .
> TA percentage Soe ard 2% jaasign Guede B,
conkye 2 ee awd £16, wsign Grde ¢,
o> Tat per fe! i.
» TH percentoge he and 46% asin 6
ah Sa pencontage 410, awign Gade Gul E,
Explanation | Ts Proreandoge b eoropanel agar
the . Apect#fed qeding olteda , and te toonospondiing
°
qrde i assigned aceordinaly
oO6. Oidpad pr Results’
eo Dudplay thot total ranks, peronlage jard ths
COsprasporcling grade fo the wer,
Explanation: The taleulatel values Catal mvootka , poronteg?
and grde ) ax proertel as tHe eutpul allawirg te
Wer to Aer the vol sth .
4. End
Explanation | the psy termination acter dispoyiry
Hes sasulbsRest!
dws thee Python
ifthe Fovograr do caleakde total ren 4
,
a and gaede 6t a tudet s Monks slain! §
wm
a“ “Five subfed+ ae do be ump by wser
pssiqn qudes ds Exeadal §— Suceo wl |Raegpam 1 te tnd tte anes A coca,
CBucts = Alargls by axerpticg A
Fara merdors
[stom wien,
develop o Rikon pamper Til coleskes tts anen 04
dierent geomet Abaes ! vuckrylt , Aquose , clels yard
Soria le ploy accepting Auitobls fmmd poamdes rem
The wren,
Alqentwm
\. Stank
2. Derplay Mew.
=> Dibplay options ter the wer 4o dalek es Aye
Gt -Abape CRedarglt , Syme , Gaels, Todargle). |
3. Preah User Chica’ |
=" Rasrofl dw wer to clase a Sbape.
A. Bare . tn User choice
> Bt the wor pelos |
e Ren’ ;
|. pxoropl te user to ondey the feagth |
and wlth, |
2. Compe fu are wing the Fen mula |
Aum GF Reclame = length xwislth \ |
| text § pam oF Revlon Y > > \ text |
, Slongth \Hmos \ text Swidth §‘Oo eee er
PE. No. Q
3
Date :
Dowa 04 Rectangle = length x width,
wm Sqpwe '.
J. Rare tha wsex do enter dir sie leratth
a. Compe the anca wiry te “Fone + Arca
6 eaide 2\A0k Space ot Sypane Go tot
Saido G92 Asa ST Spa © aide 2.
wm Conc | .
|. Pawormel tes user to enter the sod.
9. Compute ths one wag ur Formala | pres
Cube = ory oradin 2Ntot S Anca’ Gc 4> \pi
\ximms \fok {odie 4%. prea GF Cle = rx
wodis 2 Cylwa s\n approximately 3. |nis9),
= Todarate |
1 haan he wer fo onder te tase ard Ie
9» Compite te axe wiry te “for mula!
Pow ot “Torleungle =|2x tosex huilt | bod
Sper Ot dnogle’ = \ ase Sx) Sa% |e
\fims \tert Chasey \ mas \ to Siqhtd
Pasa Of Todange = 21 xpare x hated.IP Ex. No. ;
Date :
BD. Ddplay Rowkt
© Sho tw coluote!l aren Fon the Jolidel Abape
6. End,
Explanation :
\. Functions!
Sepaute Funitfom One deste te leulstel +0
oxen ST Goch Alaa
=> anes ot aadengt 0, Takeos leh anh
width as Erp ard och ths anes OF the
wrectanges
= oie — ot Aquat 0! Tales ts Aide lengh 04
Wed and stetors te ote ot He Aqua,
=> ate ~6f ard O ! Takes de mediv as
Fopd amd victors the one Gl ts covl,
wing the math sh conttart,
axe — 61 driangt 0 taker base amd heigl
aS vinpitd md sneturns tre aren st He tbianls
2 menu.
The propia displays — a room Ap vs hen
allsuirg vem te clumse thr shape toa Glich
Hy uel to Calculate dhe aun. ts
oO
;3. User Tnpud !
Based om the whens holes je program
paswpts for the sopinad wy
Cl jwdkth,
viadtus , Ade , Lowe , and ons ~
A» Gleulotions |!
“Th appropride Formula vd wel be calate
Hu awa ot tw elated bapa.
5. Opi,
TW talewlotel oxen ds duzlayed Lock to Ave
‘ae|
Tar ‘The Wither Regpwn 4 fod te nse Bt adhal
ques, Geil ard hriargt by ocupig putas fmpte |
Pumawdeu From user. fs Executed Recor tully.TH woils a Python seiph ‘tha poets all te prima swenbo
lev than 90. Aprdme number ib a rota rwrobe green
than \ thot hor no postive divisors ott than | and
by
dt.
Pi\gositaa
\, Seep 11 Deviate sare of number’:
> The jak ch to phd rumbers lew than 2°
So the atarge vill be fm ately a \b nd
| & pods rumbber
a. Step 2: Tniktatize @ Joop. “for. checking, paren?
ey [oop towugh all numb Arerting for DP
fo Chad nel dndlaedleg ) 20.
© ep: Clack Sh a mer Be pit
2 fan cach rwmober n, chuck Oh Dhar ann
divisors often thom | and — Yoel
a> oop Howat tmunbors ‘from te wl y Fon ah
number , Chet 4 BH divides n sto a
vwralrde Cie nt $a 0),
Thy had any divisow ol qian land Bult .
& 3 not @ paime qumber , 40 Akio D ,
ow
0.
)
320
|
A. Step A! Brit dhe poime ruurnben
27% 0 rambo har no divisers othar than \and Mel
Pink dhs numba.
Explanation!
\, The Stoel roots vilh 0 loop tof thoutes over
humbows Fstom 9) to 19.
2+ Fox each ywurober , Et Chucks divisibilidy by nurobew
fo Dup do ths cwsuent ruber munud |, I$
number Lb Qiviaible by any othr qurber fesides |
auch Body | B wD nol a pats numer.
= TG wm divisor wb ith B soe w
Con sidercd — podima ord wan pode,rf
8 Ex. No,
— 2B
Date :
RosuA!
“te Paxton Program Still etal ports pete nuibow
les tren D0. BD Exeuted Succomfudly,
oF
GoPaeqorrn to fined foctetal of the ghen
~ Oy
4
Mwy best vata, oWausuive. ‘Bunctlon {
TS tonits & Python proyam that toropubo the fockertal of
A ghen tuoben using a vretilve function,
Plyonithn:
\. Stood,
2+ Inpd + Reod the ruber n {pn volich te
Yous to be (propeted,
3. Clock Bn BOaly
=» TE BO onl, actu \ Cas the pochonial
& card tH AD,
A. Recursive Cal ; nll
»hne gpoakvon tran |, vocuniivdy
the ‘fumctton to calculde n * Fadertal Cn),
5. Retwrn 1 The souk oh tae uecwibe furaton
will be ta foctodtal GF tw ghen
Nur bes>» FE actoual Definition: The fpctonuad se
Wwroben n, donoted onl, & tw pacdud 4;
au positive vrtqeu trom |ton. Te frotoouad
Gn com be defined vocursivly 0 !
>al =n * (ny), with ths base
being 0 = land UP = 1,
> Rocuwie Function; p ocushe feta wo
femetton tad calls Sselh to Ache Areilon
Instone of ths problem Th fits case , He
funclin vill Kep cabin AAslh with a
Yalu of o untill Zt oodles tho bart cor.
Fat loralion ef cde |
hte eel function checks ob Hu smut n 0
HY bus, it oatwond 1 Cho ome).
2. hn lb pred thon Ay tie futon ls Bea
with n-1 Cormcunsive-coxey and multiphion n Usith
the sosult OF ths uocwntive coll
3. ‘The typ Bb Jalon {pom tha son jad He
ausult of dis fectarial funchon vd potted .
o
nf6 Ex. No.
! Date :
‘Result 7 .
Res aus Aion Rg > Hd pee ae
ier ruben wairg, ousive. function» ——
| Buco,
|
1Write a Putian goer te coud ths oO
of oven ard edd rurmbens ftom orvay of NI
fuurotoaiy’
TH vsile a Python program dyed cots the nuober
AF even numbers pom an asnoy of KN num Dew.
—
|
|
|
|
|
|
|
Algenitlum 1
\. Step ts Trp the volar of 1) Guvmber eleroonts in tha.
> Romgh the wane pot ae HO
Ww).
D+ Step 2 Trp the
sy PAR the wer
one. en vaput tern as a dik.
B. Sept 1 TriMaltze diso imal en even an od
hurbens, |
a S& cyen_ coud © ard odd _ court - 0
fo drade tye nainber 6G oven and odd
numbers, susapectively.
A. ep | “eveve flume cach clomid & tee annay,
2 Fen each elawort , Clade Sh 1K boven on
od wing Hs module operator C19,
5. Bep£! Troument the teunles bared on tle
fuwber
= BE tw et divisible by 21 tncroment
even
ay Oth wise 8 tld _ count.
OoStep G! Dosplay tie uel,
> Pate He values of even _ court and old -
Cound.
Hore works by ending throunle 2"
He axiay owed clackig lather ‘the
huben fo even on old.
=the moduli optraen C7) WB used fe chuck
Xk tne nunber Ss divisible by 2 TE tHe
yout 0, HW nuwohser seven 5 ohanwise ,
Be > old.
ey For each mumbo, appoepriate n
Lapdatal , and apt tonatig town “
chamerts , te gounld O78 pride.2)
Result |
Ths the
i
tytn poroptamn to court the
nuwobey of
of N numbos
oven ard old runmbew frre anne
wD Executed Succes poly
:
|
Oo9
I
Worite 9 Pyle clan to weve a Ant
word wand
Python» clos Bs ds savense. a given
Stung word by werd . TH means 4hoh vinat ead of
preventing ths entine “ein Chancton ay character , the
Wards vm tes Matry piginiate, Hal, angivel fom , bed
Their arden u> —seayversed
D\gonithen
1 Tag the Sng
=r Take on Anput Shin ushidh comand multiple
Lond Ayana by spans,
2. Splid He sting’,
Use the split O punction fo anak the omy
Arving, ute Uedividial words . Ts function ap bb
tha stating A, te ond based 89 Apaem,
S, Reverse the Lik of uends:
> Reverse Hrs ander of the werd waivg Python
dist allebg CD45) otis cxanter a ro Lit
whow tle last word comes spat and the int
word ered ast.
A, Toon the (ood '
ay Use tha join C) function 40 concedenate the
| athe seversed Ust 8 cords bocce ink 0 Alms
Abi With Apoced Arcgoradirg tha word.
ee te | tee os i ee ee 685B. Retwin The Res |
2) Retin the feral uiversed bung , where te
words axa Yn sRNOE arden.
Explenation |
oy The Pygban clays SdttrgRen ensen onsnpautoter dhs
Logic fpr reversing dhe onder ef words Jin a Abung,
= When a Aboing is pasted fo the aw, te oevete —
by Hep 03 alasextbal vin the alperitlrn
Example |
B ths vinptt Bn Yeve wor Hd dam, Ye Aduing
LW be spt Jats te at T' peus’, ‘word 4 "He", nay
Ne" “ded"J, Vie a file Ihave voetled Fo open The Anus
fide vin wsaod mode.
3. Rood Vines from ts Soende Fle:
24 Troede Howugh exch lire tn tha doune fi
a Waa trunter to tuck dhe caort [far
ruumber
Av Chock Vine Number
»y — Lins , Chock tb tye Line wmber
+ VU Dy odd, ow tho Lina for lator coinOpen the Destination File |
=b Gpen tis dlastination fide wm wail meade
+ Whit tdd Hivos to pottyatton eile)
ey Wats all sherad edd fine te dtu dosivetion
A. close Both Filo}
=> close both the foswits aud dexti nodion
Fidos te put we dypren wsour to’
Ex planation of ths Code
= Furction paifinition ? Tee function Copy — etl - lines
jako twe panametev : die peth to the Aout
Pile and ths path tothe cloutrabten fle,
=v Lint Counting Sp tgurder Keps fruk sf the
Curent Lina pitino, bile heading toough ths
Aunt. fe,
2y ted Line Store 1 Dh te Vine mumbo us ead
thot Ure 2s oppenoleel to tla tld — Lines list,
Filo (ubdting ye toltedel odd Uiras one
uadtten fo the destfralion Qfos .
Eon teat NMonag.on3 | ths udth patedernentt we
wel for file ppevdiow to wrdut trod giles
oo portey Use} eft tot leele Sy
2x ited even of an own oteud
eyPomlt! Thus te Python pxegtom to Road o fil tontent
Cond copy, vl the tonterts ot bl Linus into a nos
file Executed Succonfully,Hs aim of ths duk us to create o Tide grap hicr
Wwindro that allows Wier +8 Uspwodty Lb limenstors
Cusidth and bight). Thid voindow sewer ed the oastry
Conve wlow te durth ton porgorr varius yore
touks
[A lganttano
[), Tropast the “Tule modul ,
2 Use ths tuonble module which provides te
Testis gaia -funchiorali 3
2 SA up te fo
=+ Grote a Acxeon’ objet
oe Use He Seaman stra Cutdty , heigl D matted te
Apecgy ate limestones oh tHe Tw le gape
winds
3. SA the Title CopAisred 9 .
3 Yeu con set o dtl gta Tutt qaplie
vtrdoo ustrg tre fitle cS your Tle tee”)
method +
A, Crate aude Dbyed !
=) Twtantiato oa “Torte abet hat Gill por fard
tot will owe aa THe
As Loindod,5. Customize Twrle C bp Hore):
=+ Cudstemi2. te tunth'd codtsu butes CUve
Colon , Alape) Uf raaded.
6 + rai beep
= Ube tHe moinleop Oo methed te exe tH?
Tha He oprap Wie window pen onl
clord by se we.
E xplanati en of trys - Code ,
+ Impant Storerends
ay tw pod - turtle vrnfeasdk > ts Turtle grep Vie
Uhnany te be wed un The paeqnan,
+ Function Definition! ;
=> The function crade —tuntle void C width ;
\uigud Hele 3 fakes Hows..poraum eter ! width ,
hufgra , and amd cp Horal fits fon the
Loirdew .
¢ Seren -Setup |
=» Soren = turtle « Seren 0) trentos a nw
Avrean obzect
o> Seren , sup Curvdth = width | hatght< hoight)
Congiquaor the size o£ tre stro usira
tho psurvided width axl beoigtt .
q
a
O:sy Aenean s le Chtle) Ads tte Ustrleco HHe ,allaving
Wes to Custemioe YB,
* Turtle -Gsuatfon'
shots fete ott O crete 0 turtle instant
thot con be weal fo dram om te Acwen.
© Customization!
You com chamye tha funtte Ly Coloo ard Abape
as desfrod,
© Main Loop |
=> ftuytle . main lopp © keaps the inde sper
onaive. to wer ecttont und A db
ard vp
closed,Rett '
That the Patten potsyram Create a Tint graphics
wirdes sith specific size ts. Cxoetel
3% Ducat:
PG DEPARTMENT OF COMMERCE (CA) Government Arts College, Dharmapurl - 5.