You are on page 1of 22
50, will be treated as malpractice. (On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages. . Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8. Important Note USN | | | 18CS55, Fifth Semester B.E. Degree Examination? July/August 2022 Application Development using Python Time: 3 hrs. Be Max. Marks: 100 List the salient features of Python,Prégramming Language) (06 Marks) a ’. List and explain the Syntax of albllow control statements*with example. (08 Marks) c. Write a Python program to cAleulate the area of cireley rectangular and triangle, Print the results, (06 Marks) OR a. What is a Functioi?How to define a function in Python? Explain with suitable example. A (06 Marks) b. Explain Local and Global scope of variabie it Python with example. _ (08 Marks) c. What is J Eagption Handling? How Exceptions are handed in Python? Write a Python progragegh exception handling gage fo solve divide —by ~ zero error situation. (06 Marks) | 7 lodule-2 a. What is Lists? Explain the coneept of list slicing wi b. What is Dictionary? Hoyts different from rite a prograntto!count the number of occurrences of character i in a i string, . (07 Marks) ¢. Write a Python program’ that accepts a. ishce and find the, number of words, digits, hexample (06 Marks) uppercase letters nd Tower case letters. QS” (07 Marks) a ‘FOR a List out all the useful string methods Which supports jn Python, Explain with an example for each a, (10 Marks) b. What lifference betwe€h copy.copy () andidny deepcopy () Function applicable to a list or Dictionary in Pythn?!Give suitable examples for each, (06 Marks) c. Writé a Python to Swap"eases of a given string & Input dav ws Output JAVA. (04 Marks) my , Sg it are the different steps to be follow to use a Regular Expression ihiPython (06Marks) b. Describe the following with, suitable Python code Snippet i) Greedy and Non Greéily, Pattern Matching. ii) findall ( ) method 6PRegex object. (07 Marks) c. Write a Python program to extract Phone numbers and Email addresses using Regular Expressions. _<° (07 Marks)_, 7 OR ra YY 1of2 10 e 18CS55 . How do we specify and handle Absolute Relative Pi (08 Marks) . Explain the File Reading / Writing process with suitable Python program. (06 Marks) . Write a Python program to create a folder ae under the hierarchy 3 files ese file] , file2 and file3. Write the content in fiJel_25*VTU" and in file2 as “UNIVERSITY” and file3 content should be opening and merge-bffilel and file2, Check out the necessary condition before write file3. ~) (06 Marks) class members are accessed? (08 Marks) ets a. What is Class? How do we “ in Python? How to instantiate the class and how b. Write a Python program t ime module within'a Glass, takes a birthday as input and print users age and the'Number of days , hours , pinutes and seconds until their next birthday. 7 (07 Marks) ©. Illustrate the concept Sie with Python, aS (05 Marks) OR ¢ a. Explain init Vevoa with an yn program. (08 Marks) 'b. What are Polymotphic functions? Explain with code Shippet (06 Marks) o. Mstrate fhe nvept of Inheritance with example. (06 Marks) &y Haines How tbtwe download a file a it to hard dive iw module? (06 Marks) a 'b. Write short notes on : o Creating , Copying and Rotating pages with opal (06 Marks) c. Explain Selenium’s Wel method for an elements, (08 Marks) a. Write a moon takes a Ne a from cog and creates an N x N Multiplication‘tabl Si (0 Marks) b. What is CSV and JSON Files? Explain with an ou the usage of Json Module in ~ a (10 Marks) S gg” & ¢ & 2of2 ° ‘ kus's Vprt Hearse Se ea Pert of CSE Sota of Urn Question Prree Qe Deeracatan Peveroement viemg Ritreavliecess} FF oo aS EL ae saeat fustuns of Python progres es ee ‘S [e4) Ensy to code =x Ever £ open Sure RObect Ord Ly Rete (eee tel te A Ons mmo ar «Pebble « intrgmnted 3 0 oot b> Flas Contvol Stetemects of Fybren aret- xt Stokeme nhs x fleet Studemest ea # ohile loop x been KGAinne set fo * if name os Plied’: a ean ‘ stent ib condi 2 print’ be ee eae eb Bae RK else > fGormacsore De po-t CH oilre) ie ae else ¢ , slaty prt Citelle, Shrngs) ele : Pa KElech t- iE (ramre o2'Pl: ws Rete pent Hi: Plce) Fa dak <2: elet pace P Cy net Kidde) ? Cte vents Logi while conkidyn t a rae cht while spames ¢ We Halle Mold) arn Sprott ‘ peat Care!) shawty > Prat (Prem of Circle my re sot Gapat (enti wadins 2) v= 10 ace Sy2y 0 KT =e RCH SD [6m] pont Cac) a prick Aron of Rectarale ¢ » ae ent GopubC Oat Salne ot lenyhr LRrendtn")) ar: Leb a: 10 ¥20 paat C ox) =e peat (‘Bren of Trtansle noe va(mpal( Gt triangle heht LRreodby'D at=(0.5 x beh) ale G-sKe420 punter): 2409. D> Franck i a Miniprgean wikia a preacary . is we neehal ta ued be a ql KDutiniry fonctions tn Fyne deb Fancome ( poten)? Bedy oF. fr ve prtam Oe tLe prvi pbsch ae Nine eo lenp est Coclan ara pense x The conte os} a een tor MCs eve] fe eee cream seta SM Creed ee sgi- det hello (rr): print C Rell, 't nore) oe hella Mobs ra) = Hello , Meh: L hello C’Bole) => Pelle , Bob en} Vac DL vewiallis That are moinned A called danctin are cath to enit sa trad Fanchron'e local scope - RVowrebles ort amie bo ilatals lett Aondetalid mvs Sed te apcek wn iaeeal Scope. - deb Sparr€ de nS 2 Loess bs priat Cos) =Z local wx def bacont >t se ‘bacon Leal’ (oo oe arnt) peat Cong «at alole al * ora > pont Cyge ) ep tabak Fog dec bacon lec! le —leal see Been ie wacen global. ) Exeagtion heading # cn sree Bel baypens Avsing The eeeention of rae ler wercagten Werdling crm be handed orth eas excep cheterents . 2th Codie. ted old pt og pt to aby clnse “The prope erection moves to start of follestm~ eccep clause if AN ereor happens - ent: aly Neem ae tee ee ne Fy Ron roars eth execptn harall tag def spanr(d Dy cera. 42/cl except ZemsPrisiean€rere ¢ print Cee 2 ce Praprenl ») pret Cspam 0) = 20 - part(s nD) 2p Gere s Balid Agnes prot Gpen ay) 7. Bad A kek te a valve tet coalains runttigle ales tn an oscdered Segprece + The tans Ust value sefexs *0 the let steel f Pcie Ee eee eral tc vale. Erk x list Cletns 2- jae. + severn) wmrlnen fornia i Letcey Hee fore re erga t= cee) chee is typed beta (ea eaten alae besa casey tunel ated by clea. ee an GD => sadox ale a ke es Bed = tsb wstia clice Wyn Bon Bek Phat toads elephant spantorsl ~? [Meed |; Vent! Sab! chyna) ae : a Spanltes 2 ur ‘se Spam [os-1J 2? [tent tbat! Seat of by Dich one son male collection oh man wel: Ulin Liste of indus, tnclonus tow Anchonoites can Se aay 7 een dota typo, not ms mtemus - s iO peeks Ger aes pee es ee ee tey Sorte Tees valnes is Called kep-varue ane. a & Dictennty ils typed en Ga a , (ies Ooi eee Sen ee TATA) AE aa Saas em » spect 7 ase ve Dretirnssi a are anorhred tleeot . bo Connd no. oF occurrences aes Python Pace ae ote ee - oe : Gaia len es boda ele Saiec sa ee) eee Came aes cunt tl petat (Cont at wom peskebys "4 eh(eomnt)) SE) te 2 rX0. of nwo + > Pythea aoa Cin ne fF woke, diss, ea lowexcane Uppacre (Lalas hak ox eatin sts = sop Cty a Gobme t., ee vp f jlesaB rowrag cline von ste split) fee ttn conge(len Gtr rs ih Ge Tye tol acd beLidee 2D: bnoted Geen ee pe EE a4 The wsetol skiing eis a elit wok ta C! c[sp+ +4. Uh CsteCdisdigt©d2? aed actteds am phen exh — Appa C) loser C2 , 75 ppt’ BF tsloser (9 x Xl) startswth 0, endswitkt 9 Ryd tO, pork Ben0> x pp Oo, lease) rehtn nes ctermy vohee all letteos in ongeal ste hove beta Gavthd nppacne es lovseecane - Sas eee Calley Seer aati ld tera Span > ‘Heus eetd - pearl aes Spats 5 ‘halle oor! Spam ' spon tsloser LD az Yes Tene 2p hello. ssqlpmat > 2 Teng. > hello isalphe ) =yFalee ~ hello “e agalnumlD => Laer =| Falst Cr) ain G Melle) = Tee 2 ‘alec '23, endso chet) 2 Scots pts bets! _steatse > alle, voodd® ar eso (Cats! den w bel, wp ath + Mellerodl sp ee rein hynbe MALL ap roel? te bron tn wittelle'. cinst(aey =? * Alle! Welle! Lyrst(s') ye Mae xe tee eee! Rspam = Spar Span conGam Enns SamSpar! NZ Spare -stetpCampl =P BaconemSyy>” D Panctton appl! Cole to en (ct ton dictvony, | ro Rye is oo at =) Tt thks ot aspamedt tn Aictenady , The ke of a valet aeherere hea Elback valre to veton wt Hat key down’ C08. wk. 2 - 7 pi Iter = i apples Be s ‘Cups eS (ens) RT Era) ‘ sbe(ps scT hens « getC ‘cups', a+ Cys! : . + hGicdte . op tCeggn', Or leass'- lS es baying Fes ire bateyy euCate x Diff nee between rey -copy D Lop. ee x Gpy- CPYL? Can be need te make a dyglicalie copy ot aw ent ble Gealeecd [ke alick of cicktenmey , ret pst A Coy ot a wefreonce. dup copy ©? will bey he panee lech elements abo. 2 Swap Cores. ok geen Bacto a topot C* ee eS Cle) tae poot G she. sre pcare ( 3) Dc acest test Sl onterh 6 TOO ss Sy Regalos expresinn alles “s to specity _ pattan aaa ee eee tre) eae ce Fe Gates gee ee ele ene re ES as Pythes art C- 7 Impert Regen module with sport ve. QCanke a Ragen obvect ath, reempled - & Pav Te sbvtag You coort to search whe bee oe okycts eee eC sis) webran mode obect WC) the Match objets grpO & Pea ee oh actral matched Text. : ca) - pho ve compilt Co'Ga\a \) (aad \ 0) mo = ph + sence Gn ro, TS RISA SSS 2K 2”) »O Grady be nen ~greedy Pattern Toctechsns % Pytren's starls enpreme ae aredy by defanlt, which eens tut en ob ignens stthebus Be web De bengal sbring porritle. 7 era veasten of the bier tt obyactclon. rigs ut stetng pombe hes the dostns brace follosed by Questia Mosk . aa ae scompile Co's) §3,530 m0 = 9" ceaach (alata Hated, , mo egronpl 5) —> Hartatalta Ha, nqee seompt le CenDs 82 mon 2 nae a Search Rotattabtalte! mon. yen C2 ay Bayete @® Firdalt > t- TH wehan te Stetngs oh wey motch tn seotched stetnra, To see how Coech() setans a Math obgct only onthe fred sathent ot wrotcliicy text B Ee £1 pheowe. cmpile(o \A\A\A AMAA-\A\O) mo = ph cease (cele 4IS-SES ~AA19 weock 212-S5-onr8) “ergnp © AL Ws-ss-9.995 When called on a nae with no grep etching a ksh of cbetey metches & R Kheo called onan TY trod has Ops Jit setneng ash of trple of strings . o> Python program to eatenct phe ne. £ bre adders usr RE ¢- Lee ipo pyeeeel® we phecescompe(® : ‘Cahsy Ned as 3\))9 (s y-1N\5) ? Qats3) Cvs O4qud) (st(et}x] ents) Sen GAL SDD 1) 5 veeveesote) em ae Com pile (ae ** C {a-29-20-9. ath @ [a-28204- + Oto aBT} hast) J, we vetoed tert = stCpypu chie- pastel » wei OI for ge to Ph-findalt (text): pons = toh set ghid old, gL) if geCaye proses x’ 4 ort) mod capper oS) Bs) 69> bs olute fre ar fA em. Fada (text: mt. append Corb) ib left) > 2? pyesicke- copy(* Nes wero ( >) post C Gge b cliparesa') priot C\- wpta(mt » (Cas pant éN. pr ne, i ereen @ Relatsvre Paths ¢- ees clS alerys ae ete meer ara! s enereal cocking cheechey ak. Dhosdale Fastn: -cNbncerl\gpaecsh ) adds ec) eee ee Reldve fpr x ane ie q ee “Nb alsen x painters modal prvides CU eadlcus ees ae mhetin ate Pat fs an abet, oe oO velsaning the absolite path ob a dative pvt 1} % Calling isabsolnkid on a Path object Ae a 2 aon aia sepevoents AN absolute pan or False bib seproents a velahe pam. i- Pata AOAC) Winds PRC crlcadn Hojo) M padr «cud (aie Gicclitedt Jet Riteo.229) BD? Paty Cspan /bacen/esy-ya DS $s obs olde) ee w os-patys abs path GaD) ROS opety stsabsC. 5) wpos pads. sel path Cie Ninel oe GND SP “Wiadund 7s ~paPheelpath ( ClMomdese! 'CMlepadegys? “Nadas, > The File Bditqa|rethns Pro t- ae) eae pee xCll fhe openld + when a RE Obit . KGa wed OD /roskea on File Obgecl # Close Tee Fle by ols chose O oa tla, dhe. pee ea vel eae 20(Paby. howe 3/ “he tlo- byt) Kelle z ae Zaseas [Poni Hells «tat!) be hellcon = hell i . weAdC) hellGn ser Hallo World! hel le = Teed Unesd 9 => No .of [m9 “renal bacenPsopea Cbaconel at |, tod bacenFs wvike C'Helle Weld Ndd. => 13 bacon Fs clare lo hacenFs open C'bacen stat |; at) baconF.rwstle (‘Bacon ts not a vegetable’ => Ake Con 2 bncooP. nado petab Coos). => Rulle wed EE cll vegetable : Ch myport of ; > iw tanealC Cappo) blsope aCe CoD piback files. bet 8") Ga) bh = 0 CCANDALP yedMiler tab, ot by rope (Ce\\Poc\\ pihe\ilesbt 7) bfewate Cv) LtL. mate(* Uursveessry" CNet Jand ClbH) ot CFL doeont ot) eke cm = Le eG ses HE (es 4 one 2 b> tect dotbetice clas Tine (obect)e Tovrozdatetime AstebrmenaslI def sibs elk yoo trons dyer, heey mine cecoa)e CelE dates datehre- deletime rym dy heirsta, see) bed mys Tog) re buch “Tega 204) Abe aa def. biti staC bat agp -bodey yx-bA-ye) F Cadeons = erbedaynrn) oot (adcly <= Foday Hy Je a) Stee Kteday-ron t ESO ehes Bsa) bedh_ = Tre(to day 1% bodema, baba) date tea = ste (bith. ~ today) split ACen (tea) rat Bags = vt CELT trees thaCaeset ("2D he stimalo} migstinls 3 seckee PIE 2) 1 Chas pont (cent CH Te is well be a Aancten ty mod: ane obects Al acts as poondus. Giese victble to the calles. x Panctims Bat week for fs ort callad oy Movsereee ey? def Inca cee)? ° Limaecect> sec: if tree SeC 77 GO; trercesec -2 60, EEE dime venta xe Me AE bereamin reeot 3) heen o= €O Anes hon +7 4 Say Tasr ©) isa specs) wettecl the] ok Jovoheol ven an obect 35 tankated Ts Aah nme | Seen ere aed —at-(selh brag mine secep): wre he beaten ea) Selb. secs = se Del tan alee) timt petal tial) — =@ 0b: wD tines Te Gx 5) tnt = potobe bnel D) Ute Ci ch sebuns a string expecnalatiig ot an objet. deaf 2 Ste--Gelt): than ‘hobs’ fade fra! flaltabe slbenio se \Eesec ) fora xtra Ges) => Ole ese oy print (te) yesteo> ts wed| (oe dabrspying > ASR Sew b meet streets ct naloe: aieera tere ere enlt type ast call oly mocehic . TE helinte ede noe. selena of te fanchine fr chy alte work foe othe Sega rce— typur. tion cdl ne pee noed SY Pichtonsay as collec he shrarm te Cont i205 of tes cach lether Appears in a Weep = del beste aay. d- PS 5) (er Bie i rene d(cJea mte('s for OE , ‘Span! Ceeentoie ie ane oe p bacon "sone! q (a) ae nt a > Toh eer tance A ere cemnrereal oeera oo sohutts all te Ran aera pre pater a hep cS Oe er Belt ee ta Cee betny Child clan welch taheits tO mnie eel daved Clo : ; t land rast ae Ss Af Gelb from, Troe) Salen oe eS eee selbe rarer = Ea dat ponder feel a elt frame, pet gel bene) X= Paton Toho” »” De) Fa potatNearel 7 > Ehaderrl (Person) WNP clay Ke Be eleay Gane “Ostet , Re potatnn SAG 4.3 Regyst Re / used to easly teach end Ro, fron web wtthert hauing to worry aboot comghatd pnw sndwiac nekoock eaves Gama problems & data com Bay K Povon load: ta be Asta seayreats opt C >) which takes a stems of Wet ty dovenle ad. «& cnlleas type C2 On eepectse get J meres lens} wthens a Roponne obsect which Costety The wel Seven get Loe your request topoct se opness we sequal .9 of ( “ati 2 Morcteoct Wf snp alalee bob) type (ea) Pe SA Myntr. medals Response! > Ae Dw. chatre code => egmols wcoder. ok, => les (ser. texk) =? 19498 | K ALK: dorsgloading WE AN Sart he cabpmse Sete (Ciesla ces wh cht epen(2 u we ebe or Fi} we have be ae Fle in wethe binety mode i felen Gals! xs eeand! eva) be opent > - een RL we ned by eorthe. brnosy data ioskad of exk dock tn oedlg te watclatg vvcede of text, iport ergmrests ; ae es - get Cites bostry shat. com] Hb) iD) eee eo ; leyhile = ope nC Pome Tal» XY wok! ei Chnrk 4 er otte contest orewy) play Fale net be COhonk Dy sev 2 "99921 PASI Se tras aH EN b> Cessition PPEst- ¥ Open of Mort ¢7h ob cts x Corafes a neo PAPE ache Obect RGpy pry fom fre Pate: LRandie objects toh, PALF: Gbortte Objects Finally nse PARP: Loe tee Obst te ontent pDF. ¥*GPpys Risa oieencles pyPPr > to Cepy pe fron one PPE cloc to ancth . Ew PPFD sticy POEs ho PIF PiLReadet vette He ‘enport py : xf Ee Soren Qreorm edt’, ek) Ble open (mom pad ced fee RDP. pl Fil Peodet (pf) f 1 I peas 2 PYPDFae pt Fil Rend pA) pfs = fyP Dea pal lx te OO Lae pote roegelrtes moms) ioe phir oyt Rogelpryer ) Paid ber add faye (P 2) 8A Fe (fas anon Page? poe pre n gh hye fae) Pabaetke sed aye (P2D )- pad sore a (iateeabata dese rob!) ae pf tons bor vo eC Ae) oe bp clac( >, Pha-clesel 2. ene Bee BOSE Dare sears eet mcreneds oth, wotateEb dice b wobrteGuntuGecboret >. K Piry ee wast 90") L80 990 | C> Selenta's WebPeve cbgeck hare $00 mehids for oe elnrents on page They Been ie aets tind elamest ie Le finde rads rretrede . ¥* brad Find elorent. x we mm Recieorae sth a csyle Welkleuwd obyct, soc cbgct, vepreseating the feb elemed an psc me mer ~ ee teak clone ats_ ko nethlids wefan a list of WLC} dbsecks bor evely motels ~y elimest on pre - Mens - Nae Webllnre d bs wchtned, x browse find elmer ~by -clars-nawe(none) Clea wie des ieee herd ty dG A) — Clemrale itn anstehicy 94 as Abshth vale R loce tind - ebe-ent cby-t “yn nine) dlimeds othr a pet [3¥) efor slesum ark we bdaey pros = ewrbderves on 2 brows opt C Walp se flivventorts Py thence ae hep ons fd efenk by leclees Eee) serod (Fonnd dlimerth +s ace re . ¢ Je (elarmelyroee)), ea cae ik di test Lathe! * tab oc ee Pera tas. nant tag name ae as ary lp) chert ) fy tented clenes dy toyed. kent. becatren Pol ae buys a Sn, pos od chert prye Dy Each Vine a CSV fle ses a 2 19 the sprerdshee ECA seperaly tre ells iy Rk ’ ob csv bly ts sey rently Tne ort xAov ? ; fe . idol s. poatd by aay ty ee ae ENS yor) can bs ABs an bel dibs ee oan Rey to seperate a Cprendchsol duty. * Dor is a a x Rey Ms Recs deta aCe Cierale hinman-verdalebe ‘chang. TSM ps redive ns TS paces meite ther DS £ vosly sventles Py Pen portal (2 mold prod ce. a ser “ “heme! 2ephoes ptaGdt bre, "etecn hb 0 “felrg eM. ry impoct geen. yponPV= ‘ssoneloeds €ete3) eat > Wiscabt Pet eel 10,’ mom's'209 xe, \ felinetQ 'y Mond JFeoP 2 agsq, dams ponvale? v i Re : : te & lds en 2 Mpacadte bwed lta "e nal wens! e0, era) een Oe atthe ecleiee re be}? sti wD. FSON La L By Thin rales fov goa badel) & ys00 sd $C de KTSN Cat chre every FE eall ara: h TH cota + String , rot fleds, Boclenn, Lick ‘ lo. os mpect sys, © geopyal from open, yal. a Sneek beole - doves asi imped apt selunn_lettes Ghamn wna x fron chicy newt Gs-osy DD wb = oenpyal- Workbook (0 [fors) Cheebswh sactive bare Finxt (bold = THe) be SiN many, ot2) molkpla = i-! Leell = “ale chG) chet [icu. —wthelce lf - font = bel ae i aa (es cheat [e€lJ= mond bglice shel [GQ -foat= bell Pan mse, nerd \ts=*-1 foe 5 rarge(a, Ayr: sMnls (-1 cells faba letesbrG) Slee ffeil} = tet aemal Dean, v Chet freeses, ann > ¥ By Ore wh. save’ nlTab- x{s ED) : prob RAL Nd)

You might also like