0% found this document useful (0 votes)
22 views24 pages

Minor Py

The document contains various Python coding exercises and examples focusing on data structures like tuples and lists, as well as operations such as sorting and searching. It emphasizes educational use, showcasing how to manipulate and analyze data using Python. Additionally, it includes practical coding tasks related to date handling and mathematical operations.

Uploaded by

kingbolte2006
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)
22 views24 pages

Minor Py

The document contains various Python coding exercises and examples focusing on data structures like tuples and lists, as well as operations such as sorting and searching. It emphasizes educational use, showcasing how to manipulate and analyze data using Python. Additionally, it includes practical coding tasks related to date handling and mathematical operations.

Uploaded by

kingbolte2006
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
A\ a4 4 ah dnvee Vein a 18: nage AL Prefession with -, | toe Peina(" nati) ed ak a ng: se ee S + Then) Coch pling () | lines Shows the tebpeckive fab ad 5 “| vale aa Commo) to Sefetak Jo ant vasiahles- 54 Saotes tre valued in nom4 and Angin 2 — * Then i} adds doer and soi the weet jn som LC _* | Za PvinyS Som with a_cleak metbage ving Print () cM 3 | Bre aatigns the vue 26 10 tne wo%iahle number - = * Then, alee Sqrt (number) Cabilale® the Squali oot and sdet2 14 _llia sqvk | + | ce quinis tee wie tans ()- takes aati ee 7 vsieg fof haces Riri ae vt suapled saa! Sell "FOR EDUCA coe’ ee Peep ccee tac: pune 2 Sejal valShuan S| . reas wy ef S uv profession =" Studeny® Print ( protite”) pint (’ Names", name) print (" Ages E age) print (" Profession +", Profession a eS Beactital 1 ; bin oe Mae: “is ae a a toad Cintal Envy first number: ")) Lom 22 Heat Cinfot(" Eniey Serend amber :!)) Sor = num d+ hom? Sint" The som of!” nomi, “and! pum 2 Nis mm) 1 7 __ aegieTBIS > Writ Syne Spat a anu Code : ge ee eae \nPov smn adth 3 is — Mum bev 225 _ - Sq s math. $47 1(nembed SEER Pring (v =i Sqy4) Peoria Se FOR EDUCATIONAL USE Beto swophing 1 @=5 ae Ah SwapPing «. (piso = Wri o_ Py tron Code ty Alirare ae me of trianaie, cod — pase Float Cindur(” tay, tee bate ab a tninnss a) heldht = load 2 Cngurl™ Ey a a angie :/')) 2 pitas 006 * bag height eee Pinal The atea ie ae 2a 7 Ae _ Qractica) 4¢. P : pa ey = fe aa ee +l pin wt Puthon Code bo Swi les Os —Cop ; 1 Oe 5 bias : b oteae a : = Nb tbe Prin (™ pesoep Capping : aa pas, * O bie by a ina “phe suapPings 2515 —23~ ele conjains dhvee inne eb “ane - cal pS mak ms $9 a. gph eat sit Sane elt —— Y e foncHon ¢ a Palys + 5 J fle coniaing_Subject— mark : Pie ested oP) wetornS A Sorted list baked an Subject 01 oom art ) fonwenss that Sorted list back into tufle and pany it se i sy ‘i Ee 3 J 5 oF s 7) oxiginal_—list is deHined with fowy elements « i ae ps. | Cloned —— Sse exigina) list Coty () makes a Sefebait cof. of An list Both gi8 aks Pvinkd 40 Show drwy hawe tr Same Cements bur cu diftetent objects « < A tuple + with value, (1, 2,3) is defined - eee The code _dvids Jo Change t fo], which saises a Ty fe&rrek- The excepy block Cakecheh tet evigk Ond prinksan | ExPlanation » FOR EDUCATIONAL USE —PracHca) 2a y Rim> Writ a_fythen Code to creak neskd tuples: nec ed—duPle = (C* meth” , 40) 4(" science” 4£5), C" Ergiich", £5) Print (" nesed tuple 2”, necked tople) j F writ a Pythen Cade to Solve i nested tuple —oSing soxbed fin csior. Pam. Code = = : [nested tuple = (C woe" a0), {" science", £5), C" English", ge) —_— Soiled nenkd = tole (Saved Credied pee) Print ('\ Sovied neaied bopiei”, Ske neki). (oe Sorc ee || Rim wrire a Python Cede fo Gy ov Clonee) Vist _____ cade - oe eee original —lis+ = ['2,1, 22, nea] ee Cloped—his+ = original —list (hatte Maia a pins ( origina) —h'st avt'ginal— h's+) — peina(® Clone) hist i", Cloned I's) FOR EDUCATIONAL: oes: not SoPRats Fewcovs ‘tuple | object i +p Pied Bat imrtutable” fine Parnone Woe a Puta — Code to Check immutability Profesby of Python ‘ ty ad FY + Aim juples Je- Pee a t (3,2,3) a 4x4, piss 4 [o)=t00 ee as excep+ ee es Se Print CY Error" a pin Lopes 2 eit_ina ein yh oe Prachicos 3 Stoves tht fol) Sensiencoh 5 -and__Seaiich etm holds +44 do_ Find. line Search tevin tn evs ts found. Prinkd using Prins(" Found :”, ) ‘Netyns Tue sf tu Sesoyy Gs The code uss BeauiteiSoup 19 Mite an Hin eile Coamplentn)) and ex hacs infetmation from ips 2 The HIM Code , Pages is virh ae ‘him! fatsex! and Creases_q Souf Sbjecd te Nomqak H+ HTML swochre phbrat Zt then Prins tdi, ae fist heading. 9 fiat Pataguaph Thus IS A Sample 4 Se Rim Wrik a 2. the text we want 4o_Seatch + cate ee tert: S eython ii is Reset Proqraunmning langvo-ge.”/ Pere term =" Powerful” Tpum(*4ek go smtchi", tery) Paint" rat che dems 3" aaa) _ tee | Paina" Fou atch xen iP jou) a tra— Writ cx Pythern cod? Fok _ Loan. ble ion BentifelSouP ‘tse erveling=" vt -3") a file* Lith open" Sample: tm)”, hte) — Conent = = fps veale) Soop = BeautitulSou?_ (him) nen, \ him) far ger’) | Prinal” Title:”, [Link] wing) |IPyina(” Firss Healing :”, Souf -h)- vin ppsina Fivs4 Pata © soup P Shing) FOR EDUCATIONAL USE Ov\Pot = Dase COD-nn- ee Date (month Name) Fu) Dale and and Tie! Ov'Pult oa hen Eimestem)S : 5 Brim Wri Pyne, _cawe 130 prime eee é [| fotmat > __ Hin a Aitferend __| a a Fron daletime _imfar+ deverime news dalttime «now () print C’ Date CoD-mm-Y¥YY):™ , [Link] (" od = om = Ye ¥" © pina C Deve Cmonrh Ni "new. Strode Cle Bese dpereayae 1) | pain (" Foll Date and Times ,new, sixfime ( & o eh B fe of do Mies Y2")) = {—_—— _ roctra) 20 i PIS Aina= writ th python Code 40 time Stamp 40 dak St ia eo sees 4am _dabelime —irnfvr_daletime __|| timestam P= |6 425 3 12.00 a || deale = dadebime-frranntimesiam? (timestamp) Prim(” Dak fm Hmestamps 2" dade,» Sinttime(™ tpd-t m-h ¥")). Racca Ze : Pin’ — tori eae Python cade ___ ee an OR EDUCATIONAL USE Se . Ovtper+ Jens 016 Mo To we Th fy Sa Su ' > s 4b 618 a won his jase is codlie thon dal t= Tete 6,14) dose 2 =date ( 2025,12,25) If dade L

You might also like