Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
129 views

Python

Class notes

Uploaded by

Jamil Ahmed
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
0% found this document useful (0 votes)
129 views

Python

Class notes

Uploaded by

Jamil Ahmed
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
You are on page 1/ 28
eee : ee Where if js used? has en is _@__high level Prtogrcaming language cohich. —Ltain_be ved bor clevelsping ole ksdop applications.» ——AT_ba sed _capp brea tions ancl web applications: —2.Who clave lop python awd) wht? a Ans Python wos dave \opad a botch prog ramrmat (nude Van Reseum in iad — —_—— 9. What is 0 open Counce ge ftousone —Pas=An__opan Sources. softens is such sopdusont_cshich —_1s_fnar_to_oll_ and can be mooligiecl by erenyone. G4 is gu -gnte £0 ptwanre. ~ aos Ex = Python 9 Tayo HFM Lede (G. what auth two oh'yownt mecleo Python? lps. Pht two _dipoant _meclta__ Pydhen one — __| @ senipt mode — Tn_this _pmcdle_-the _jn.stavediowo — an__twmiten into @ Silty saved ancl tan be uced tobe —execusecl by the inden pazden ata tad dive. @Futeaa dive wode— Th iso _commanc\ lina _chall. which gives immediai® ecu ld fon each fratnuction. —{ type —___— TG wahet is the tension of —a_byshon— Bil? fns- The _exdensien Gp python files : | : . - — lé 1 6 What do gov mean by TD LE. a + POLE ate tngeyrrdcd Development —Lesstnring. | Environment - - = — - [7 torte _the meaning —th__gollowing su mbelt tn | python —_— [png 4)_22> — Prrampd boot US es * = : ji ad = nme Met Cacoletivision)- OM 4) / ——> Dirisis pe : |g) + > Addition —— 6) = > Sebsina edn [3h se > Hult plicadian | se_the _Peinp_fonehion (J ic_uged_4o— oe | leeerfe a —_shortt ole __on— Pret cpg a [output op the pitognam —aino_pxint@iy on ste 2 coetn— Ite Pink stagemenf have dhe follwing Syrtox—— | péint (“values endie"tnt, sep es”, flex SpStcl) | Bramplee et E SS —_|-2) Print C* Hele ware!) —> Helle wertld |_2) Print C® Helou” ‘wenkh’y Of", ‘pythons Sep, “J | =. 4 _eventol —~G python. 4 Sepa) - em +} >" sma — oe | Cueto) —> ke to -Seretal oS a eS | Datosty pes in Pythsn_- Dada types ice woe Aichating What type op data Warcieble halols —piyFhsn——Paegacm...Theat_ane_vthave typeh of close, thay ee lee Naviabe = Variakle is name given dw parang 8 bates 4 —lbeading cahich holol_thr lege. “3 tf nput in Pythoye a aah python usith |_ the halp_of ih pot prchanO) [ae inpus(* “fasten eee ou: | Entet_the numbns Lay olefalt alata ic ancicdanl asa Lining in python ——}-4-_The_Sdaing tan be tonvended into an tinge gea_ndite — —hohtlp_op int C) which is a muct fae input Qn —inkegan. 2B - ee ee) |g. -luitite 0 _progaam to dhe pinch the sum of tuo Yom ss 5 which i. = Pima tase “Ba dn ths 24 yas") Ce oe oa | ie Prive (“Che won is, 2 | Se i | tite a paogaem ro inderchiaky the _valits d ter | i ee dacl_vanieble, | —_| So) = nt (inp (“Ener he 18F no, a pee input (“6 néer oa 24 ne! print | Be fone. ad esas baci —puriht ("B2” , b)- sat Sa Soe gt | aofene scoappiiy oe _|_&: ccc aa peel O— The fnetion Ls. used nto eval iStoing of any logatexpnetsion Eh re Lvaf C6617) Gaus! j-Gdaite_a__ Progaam to accep? —« ine ima bong | Fie_veen_anal_netenn« the _ovenaye - fhase 3no Osing the eval () ac | —$ aren O = eval Cinpot Center dhe_gnst no), __ val linpot | (Per ip erond po) ____ “Buf dhe sthiaclbuestin)) __| Som za th + z —A_= Sum /3 7 —- = Petit oe te AD — : cutpot _ = ee Pine _ —Puier the second nex 2 Ender ths thtnd ne27 + _AVeepge VS oy | Condidienal Consinvcdea Lj) Pf stapoment_ = if nest Cnobij'sn Stademenfp 4A (01 -Ulse_stadement = Lh rs tet so execute a. 6 | Q codes. if panticelanconclibing Us Ane yf . |_hen_another6lock—of- ccates_¢ executeal , | -Gis as § any _— f a7. - _ —— | as = } Part C* wellac’) _ ___ £hte i | if me ee ete Ot - - Prive aye a - (WAP to pindl cot whesren oo _numéer_/'sQolel on 2ven+——| >t int (input ("Ena the nomber’)) ese 2 Pitint_ Co Tre given mo. fs even —else _ —— Print Cue given nots adel") _Oukevk Enger tht nun denes The given jgo_is even! | Relationad Operators — peladionel.. Operadtar dae _usecl fo compart fhe ne ladeanchiip _b2dweth tuto _clada ides sna coual honed erpacssron The Masuli ep the condition is either tnuc_oa_false. en { > > _Garectea_ shin S bess than > Gocadn than “geal do - — —>__less than equal _to - _ = Lem paision opamedon a = > Net equal cpmafon _> < 1 fp— elif- else = Syntoc= ik st condition Cg G27 | (em a? Point C* Hello’) lip acer a ning ("Bye") —— elif we > 44 Point C Cnoa4") _ (3 - — Pecint C'Ba va) COPP tr python to cla derrmins fhe gqnodt db & gtectoul | a.se.ckon she _manks given by she User. mu p> ns intl inpot C"Pnge the hum bea") — if M > 10 and em ctor: print (" Yovo goade is ny’) elif MY ang n 60 anc wet " Point 0° toon tnenae fe @,” CE M2 SO anh meet Paint C" Youn —fonage isc) 1k“ ?4O and we ag) Poimt (° Youn Cnnde is M293 Son ——jbmper= this on vseet fon i itading pevirmage coqoence —— Thtte_aa_lto_uctel foo repeating ene cdatement tnuleip | steppes ee | having the sa me late type 1 16 peporsented by £7 Artag — An. y-*S0_Qnoup_of multiple Lada _idenns | |) Fon loop=A fon loca is usec! in the following eyndaz— + 120 ange cf num betts . fon a specitded number of tinaes foo _vanroée nant jn Seg vend. — Eva fruits 2 [\apple” , “mangot,ynapes “J __foa_% tn fauter = Ca) i a | Wonge() = Che “ange (pene is_ustdd te -idenade thacugh fae | Nok? = yans@Ch) meant tke loop iH itenate fron__| eee ae ee __Tbs__rangeW_ tah cule be wn Yen ad range latea), 7 | analy inceee mentLobeenement) | pte ange Cas, ai t 2 a) e rare cin sa | fo check if the conotihinnparcerc ing anol | Hot - fe pea So HB not opeaaden. | Give dhe nesutlaut- oe | ¢-3 . a : fa een Dock om bre | 3) mot (ach and Crh ran 2) |=? 9) 1<2 om 2>3 es eo ivan. wn _secoecling the, AS2 and Sx mts4 272 and Gee, 2 mek (TMve and #atsey hot (false) - éol a int Cinpet (“Prien fie nursbor)) fot_i in range (1, 041,17) TEE, PRORP TT 3 —| WAP _in pyrene disptay ane fist Lo hadwxal Wo tn Yevensod Oven = a eS fox tin youge Cojo. s) teas opuet is a Op ba caprsea b | | \- poo [ABP in_pytnen 0 find athe. Sumo) fsa © medal MO. +) fo i Tonge Cue) ae alee ae SA & — £ ar a Prime ‘Sums! 8) [s WM ey >) — | Wite a pro, eee thon to finel_out the —|sum_d—onit Digits of thicken bios taktia 4 tnpet foam heuer sh A “| | Fintey dhe J 102 *) I Ender te bee Tnput ("Prder she 2! n0- (inpor Ender ghe ad naz!) ender te an sum gate ails SY) Findes_cts_ 2, p22 Ye 20 int ("Sum op the clisitts, oh _ lta hile fea = Gh 1664 = body of dhe loop. | WAP to frad_ to adséract Cul put Wich ne saved to. | out Pury . 3 uy £ 4 & 2 j i j \o the clig ts ef ad numb faker as an input and Pritt M2 ind Cinput (*#neer shove: Eran ay dz nn“/o it" ond __Ovt pa RE nuaders Sf fBP_—-to_check wihedivr cue daken ad Tippee gc cli vis thle b ie “ [ns int Cnput Fin. he nas = Yen. “dhe nomboeZ. Ke on! - 4 Ks i ——}_Pritine Cat," clivier tle else ee ee as net ivicible by 5%) - ee = —_| ee Causes Gn jmmedia de extt | po he_While and jon leop fh_which It appemc, 4 Pre fori mange Cita, 1)! i if —tzz 4 See 7e. rs 3 Point - Sef— ee —F Stade mont Cond noe sgouleretueh ckipe tha Menad nig, lin the loap 4 sha snaps conn —-| CC ypee Feu ES 1 Wegine Cohen Pyhics 2 Lane= Cyber Ethics is_¢aap—Soant hop philosce! is useol fa Qn aly ze_the _ jtadvat anol Shd_socs -FCompotin technebgy as tvell_ao— shh Of —Conolucé _eu'éh nespect to dhe ust —q-comaude 12) Define _Metique#e, Ans. Nidque te is dhe eto ved oa —gaod_mahnens thet Ane _tlecl to yolloe tn Gyb.encpace 2b Ka set G od that pe »jollacd + _| le __who car online have | 3)twhat cnt he nules af Conduct in ty ber spec. Actondiity to Viaginiad Shea’e book aar_lo Hules do fe a gooel_nadizen_oa_uetolies | DD)" Remembin the hua | anltne oat neal peo, d Loun Sad nehguvebte . sae eee nw) tut _cheelal always obey dhe Minit of (aus avd | Cepbon Spa. Ce__drvicterey alhlt_vsiag dhe imbirnef 4 wu) Knot where you Mt ih fy ben space wXA seve d employ dis cacdhen ja enhanc fader Ceditno by cel pust | een nes ponced anol _btharieua. Heeeereerr eer | Wy) When tie wt ere in af Sebsise wwe Shoolel eke int do Undleas hard _odhors . listen do_dhe chads and | fellaw fhe fuebeste_pacpealy tacacler not to_ofencl. f hunt by 9 ached nespect hin postin ancl Bonalid Shuld_pay alltrrtion Jo the lesguane we ose aed | in teanet— 2 coe_shoulal_ose 4 poliitly. | on) Se sheclol lesays that pxpeat knowled gs | swe Shevlel share. _valoab le ip feameabian tin di _ | to pent, pelvomame vite anit cate i lv) We 24 ovlel have. Cental lame aand&* [a cemies op Anpag testers 5 an - 6 called flare won dss ) = 1) we chevlol feagiveodkir people's misdake even indene.| iw) wtcheeld not _atose con porten oven indovnel dé a/peck efters. [Y= Sysdein _admnicdnadees « | Open S ounce Cop deroae De fine So of tuscns _L Inconge. des mony dypes ey Ped Licencta ane dheat? Pg 1S GG | Ons- Po fdwore lincence ts @ dowmentthad-paoeide| ltged_gur lines @ how to didrieuk® anol Vea pooh | of tusane |S) Depne kee. _ | A8- PSE means ftk Saftwon jpoundadin whith 1s a5 non-popd _enganisedion founclecl by RichGarel Stalprgh | which paomater she gheedlom 10 dust ty y distarbubey 4 —engede and Aieolify A Computer. 4 fosaee » . E 6) Define th follow Png — (u) Pre prildeny sof dvane 57) Oper Scuace Soffoae - fy tsa typo} Computersof feces —tn_which @ sovnte cofle is azteesel onder_a licence’ ih_wohich the copy aight hololen_gnands the vscas she} nights fo ducky 9 Change anol dis da'bude these fdusne | Might & the covaco tocle _erclocivelyy a a). Prccpaietng seston 2 Pin this type kofticre the loanea Gf dhe Software folds tndtlectal poopendy timer | i t t —fomod ify tf a at L [ OF f : Gq . DSaoles ¥ Ly ~—O 10, &) @ float 2 ac We Be ® ht a eee", Sc ae —— d Veni (g = Ue rerlol iT ne see culatel | Drath bic Opureck Yt 2 Actetthyow loskrse bon 2 Snbeqen cltut fou ev %e __Moztule eltutsten - A eee (22 —bepantalra hin A tg oases HA ieee mar 5 pk —fe pe Noma thle hag bel?) Date: / Page No. A. Moy -cle,fesath oterber_coinofeleritel exer shrfing be _conyentect nto cam fale a a help LO) whtun th a mau tetas tap aa eoltae _ su face aa tnt a LO “Galas rea fa number 2") ) | A. Worithe ce _progacwa be free fhe Susmt og boa atinabeds, whith Ts etre lou bart Len, ll Ave aa finkl tapuk (Merten bee LLtaput Uguten the prelno. 2%) pith nel Sof ey agi OIP nik (8 die Suna fs aa: |_ Oe » tonilen§ eX Spay arena —_Av- inlen chee -Coweal bbe ah entuloles.| values bp boo Ceti tole— a aay Pie ett Us pob CU biten phe tt pf tuk innpustd “ferakea bee pel Putml _[ “Bejone_ ee | Prink Us ba” cs : + Geri ca Cintlo_ os Clad Ha a ist dau: = t bitch “ Ginken phe Ie wy. 2 | uA? Conky —\Refene eoeuaps 24 ppt Paitaks Cat ben: Siwypp hog 2a). bec. g Past [be a) | Pflen sceappiticy 2 6 f - ho ? an ea Poe clone pytbon? bo teu Rosina fia Lay [Page No. half strseaipkeu —alouk py! htg ules | bere wnrerles cb python ps anuni, a > aeoe acl Vi p fon ecole fatbituedien be byat an cs A curse oeuhen wOLe 2? LY sual énvtn Pal cop | >>> Sy mito l 2 Oubpick corel ble pritink ov'_blat. competes see ein. — hr syntax _¢ —pirtal—'s _pai nk Cirle 2s Cuela tint, — $ilv 20 ub. ska) fits “uses be belt bo gisee cs nr ft (attoy te fonalt in HD Prink CHM ello") —S Hello _lletrcemoeten ta the pintat U. | Sorat eatecanpole + pritinb cont &— AO (Ps 2 Ks Helle wonlel, I, fo bithan Ofaink UUetlo Won IO Print U'Helle", “Wenlel ; es ‘pythot's sep 2s" Je net, Waal | Paint (4 wonlel"\—> ® Point (sum "S46" ssp 40 ats") —> Abt sere pananathen fcc sepeunedton for ble _veluea curl. tuct pancmeten i he chencreten bo mantle the Lloret — tet CLe-dhe Evatt) fs useel bo estntuake chafine 4 legal erp eeosione» he oe preoston, 1's 2 Mertucrheel qin afin bine. pura + cr stnivg crral bru acouth a iebeurmeed eet a BV rt there ot ences tOL heme oY nis Se | cay ahh a ].0--Watheo_prugnua bv oeeejl 8 munrbur— frwe phe Wot _Crnel_mebamm the cueetrtene of Mus elas. niimaletia tating Lhe _tsetad bi) se me Aua'= _tnten the oth no 2 | Znten bhe 2 nyo. 2 t Listen the al no. 2f J meet (inpl(* Gober bre (Hanis) = et er Senna it Prtick UC dhs _orconerye ef ba aod 2A) ) Tp sbulenrenk im a BC — a tf (ers) on = = = patat_— Ca) ae — Mime Bop a | ig = Lado) ee es ae | Print Cer) aro - a Bip ele ShebemaahiT$h es creel be ox ecrcke a + —_ luck oy coele otf ponbvertewr ceurelthioun fret tf 43 flst thy anothen olocte « cucle_fr execectect—p-—— Styinberr“s if ( best exjattertor) eae lam re M fee Ge pomk . aed aot bebe ile = a — ft ! oo Path" Bye") : 7 fnew bo check cobchher gies ne is olf State pr “ef ——needen Heo te on iavk. nberr bAt aumibe _— - AC is _qneecbeva thes fo Cir put tuber the ne. zu _if (xsw) - - - fo Paint (x) - oa a Patt [its gieert thes tw") Cee puink Lo) : Print ts lor bheur lo") a - 4 A Relerbionecd ppurcdorrs £— nis epurecbons core “reel ity compant ha reletronhi bet wo cleat ther ta coneldtitonerl” Mrqoners tout. Tha meaelb sa ether t frat err flee ae qutcahen blracew L > Wars thew De > Gneaten thom equct bo Ze > bos. Huey eyrert to DP eyrel bo he f= > plok epee. een eg oe cel oy ote tater BWethe eo panueteua fofincl 0 ob _whibltia ano, j 4inben Hae_ny + 20¢ [ue pie b: fo ol". 2 tsk (taut C fuer teas") J i (x2 == 0) sa ae Se Potink (* dhe qivetsa no 2 4 lye a ~ Paint (8 Ma pirvtes mes A oelel) 4 - —_ ae me if ~elit = One cheatemanrl -— - guakest “elt Creal eometthlan) Hig ( teak conctition) =y a _ : ee aes! euiy_Ubtak = Conabeon Be me —— tain eyed) eect pee Bayard tty oe = Cogs ee ee oe G. Udotbe ton Hole. a tn bencheeye Js wea Wa vets ‘phe veuntertoleg cotblrouek “Using gret Pi pe emecnneneaaeneees ese eens eerenrer aa = = Ania Out pub: ———— EEE Pe fone seoaspplng = = —— | Alumben_cemnr a — = = = tra y = © pth 7 Af ken. suoapptng = a — Alumbtra cine 20 cone _ a i — — a 2 a }—4> om : 7 — Piniak CY Pefone swapping" | fo TE pntnk LU Alumben ce ote 20) Paint (ane yeti) " hs mtg Nase ye 2 wae Qe Hy vo eee Fe Ke (le 2k 38 ee Paint ye Swappiny 2) ees Patint OM Alumben ee da a) Print (conel * srg El 5 DB toupi= A fuss taupe ial jon take Oren chia ti Ayer mu! Bag pane da tht tune aber dines 4bis elonolee ee Q. Wa the—ex—psuuacuaa tia py bhona clektnuatae he tho a Shivcket besed on patied ich Pp Oubou b Santen betwee s tr | Moun Orpele. fs A Sembee bbe prnle 24) Mun tMinnote ie © Eh noun") Avat= sit: Coragae AC Su bev (FOnS 6 aul nd ror) Pert Coun Graucte_e Ar") PIE Cus vo ere Higa. oo Patnk tM youn Cele 9 49") elie Cn Yto end vn vet) | s Print (“qo Carole ty yy lik CA >66 ont ugar) Poiwk ("You taneele s 2!) @lb (Hs co tetine 61] Prdnk (8 You Gerrorole Hoch t pg ely (nr ran gay neces Prvinl-L" Noun tinaee ts ct) elif Las goad od ae) Print (“ Goun Crrecte oO") H edt. 5 Ws Paiink Loum Crete Yee") gy “a —_—_||0 1O) cintl cpemerborn —. thao. Led ced Optncctona? pc cond. fh tua ____— birut ons, pacceeel Teg cunelsurtete try Po - ON wpenefor = Cle erfe. coke thon a _y bh swesdihtna pei cesel bao “suetecol ing is? baton . = SS TC o Atel opennban — ah te len ve ~canalifion. few eoclfiny the tole cope abcboi.—§ Se A. Ortver ee Meoutkant 3 fe gleesteg nepensalon — there ti, boz ire O_ a> 6 ane cx 9 2. Died ane ax2 2 Se) _ _ ———— 2 Culs@ cnet Cela, ___ - ao > Pulse @Matbon bose > 167 of 253 I> Thus on Fuloe > True ® nol La dbo cme et). Dueb (1 62 anol 9-4-25-: Dot [Fabe ciel Thue 7D nok (fale = ee het x clok Ac eud eng | ertenyole — ine int Uirbub ( fea x fn nee & _ Privrt (x\ned Pnink (x+1) he peunye hs iy will shen pune ftom Jon = 2s tet Linpist Ut Srbey bbe r0.") ) . Pon x taney foe == Ravn (te) a oie Print (ont) The new Quan beg ~ oO h) fa inenstear tl lL neue CsFounrk perch aa ae (1,24, ¥ s x o F zg fous Hae sect | ppacl then Sota < Etre _tunth @. Waile —¢ Sa pipblavia +o deke 3 | o cig Oubpu Z | 2nten fre $8 wo. =3ul to. futon fhe 1 wo. = gu | — fuler the 20% ny. 2034 1 4 hile love 3 + a — Re 2h | c= PEO+e | 8 Patink C’Sum Af tail atigth 26) = { 2 tinth cligihy 2iodm Anst= x= fal (tapuh(*tnken the tt mos 5 yetaklinpubl*tnten the rr ng. =") ——}-— 25 int ( Papuk ("eaten fhe antl ene )) ae Ps KhlLO / 3 YO tnithe pains rea fa beau to_ cbr pits —fpona— fe —tebegen tHe Aarti ULEY Whe las 20 As ZO ee a2 Tak Lolo) |B. | loonie ep prreyrowr te chuck, sohebherr oo _tuatbta, |fercWeta ers. Tn put ctisisilol lop Cen aok. | Anon t= tak input (eater dhe Sno. 2") ed oubal = Sabta_the ne- ll Lips dy clivirGle 4 ebe - — Prfak Cb, "is_ mol ctartatble oy 6") Bncuk “Sha bewatabi — The baecrk shaterrenrt cues om | | Frmmnetecrte ect le _froma thre colrtle. currel fur soap Facute | Aka ppcens.——— — ———— B.WAP fo elaaknerte. the vot Aegina 82 3 oe n | fun is Tra__.regeee Cutt &, — a os Potnk Cf) fire = co forneek ft ——— c -_ Axmatkyt = Paint (“an"a) © Coublace. checbernert — dh fs uatel Tapas loops. Ak sktos toe nding —shaleenels 5 ths_log jCrsel_Frreuins mrad the conknel FLork leer —e dbp Pirugecina frou _tuneint. Ha, nvale% bee —| twos fat gfinc. Ole Hen Tn. eg (ud. we oa ipaee xe Ss lane 42%) a &

You might also like