Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
38 views
Python
Uploaded by
priyanshbhadoria13
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python For Later
Download
Save
Save Python For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
38 views
Python
Uploaded by
priyanshbhadoria13
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python For Later
Carousel Previous
Carousel Next
Save
Save Python For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 16
Search
Fullscreen
: —ASSTON MEN = 2 nite a THtan =. pedal thal oe Caaprarn fe Cradle, 2 Steig d- [ginty = “Hello, World £” | pdt (ste) Jecepal t= Hello, Derlel | a Write a Python Prepkan te delete a ay Prag Kam shame “Hello, dell |” puch “Ontyinall Stet 2 sheduy) del stedny J 7 7 pried , efeted Steins : ‘ shaw) Oubpstt Original Shiny? Heller, Werte! | Deleted Shey! name ‘ stretey? tt net dk [incelE 5 fay pythen Presy iam te access pte Chanactery of a hee os Poy“ te (eC Ace easing characters ashi a kept y) yarclan in § Lng? peintCchan) l lpr In fecessing specifies characters uttp fuclectugt” re US AL let shins [e7 ) J md vid (“At Pade 22”, stretup LJ) geet (™\n Accessing the chara ctites wsteg slicfiep 2”) gett (" from tude © +e 32”, shiv [0:47 ) edu (* Leon fucex 24a 58 ” shot [s :¢)) privé Chem sled te end! by jurp & characters? : Strap ltt quand C\n Accessing elaractere % anh Or 2) 2”) prcect (Reverse t i shechag [: ; -1)) Dudpr- Aecensing characers using a loop: gor bee , Accessor speeifi= clanachrs csing feolevetay | At hee 2 YP At Sndlex 24 - Recessing the characters wurny slicing? from “tuder ote as hth i sto: he Ree ESE ENE jap clade Me Reessty clenacfery In neverue pile! | Revester t nehty? |Cudsdte Pythan Peay tear te Perform cperdhiong Or Shays, eeghearn t= sar sample = sheng -" Hells, «Darl | het ya sang thing Bfergth> fen Gampk shen) i wiracwe length af “the Sheng? f Gengtt}") sista! - “Helle, : shrimp? = « World 1 | concdenated shy : Sheiyl + strip F Pak(t"2. Cancale nahi, 4 {Concefenated. shel] )) E° substring = Seniple. she fins 9] Pink: ( £"3, SIoeing SWeings { Subabring} 3) Capper case - shhsiny : Samphe shiny opel) Iswercate shige sab fe Seine. feosen Peed Cha, 9 F oF ppercase ¢ [oppercase S Stacy? *) Distt CS louse ACs? f Nousencase- stredy }) replaced — sheng - Sampk~ hong. ree lace (We, du lyn ead (fe. Bp rT pnegac saggy (1 eae) toerds - Samp ic sthcing Split. (% ‘) phn (fo. soli: fecerdf stands —cctth fells — Sample slrcng, slavche oat Celle 4 ands cath sf veiage Sa ph ship endsunil, CStheine. ¥) ped (47. Shark asith Vell) Estate eit pg, " PECL" Code echt “GHhetag,? + fendecitlh. Str index = Sampk— sheng, fad POPC ES Oden & sample) ‘} ) "samp? : fidese 2 Count = sample — $4 ( are PD Pract C3. Couet Ning. Count ( is”) of fish sf cost }*) Coalaing ecealf - “Would” ¢, Sample. olf Perk Cg int Seen te j (# "to. Conlon worlds Feed eafy | i: -— | ajoss = fi Leny tk of the sdeeing t 34 oy, Concatenation t Hells | Oo! sducng Slécby 2 Corll " o i Oppencase F HEUO, OoRLD | Ty rs t> A SAMPLE STING} Lowercase the lle, wrorl | tose tq sarnple stray. s Replace Hello, Well | Tet ik modified string. Ge split ‘[*Helle, “world (“Rip "a? 49, * sompk?, ‘hei’ ] y. sheds estth Helles Tee S bade corth “shieing? Biter & Tndex of ‘sample? Oy 4. Court ef fn 8 tor Comlang “ede? deFyguite 3 Python Pr palind ont ak fiend te check a given stein Deo Hami- a 4 i pulinelicome ( inprat. ste pay oe cess ~ Sting) t hae stray = inp Shit et 4 creed te sheetay Se tnput sto pease wero MP . iapeot CG rten a ae sotto] { ees fuptch yi) oe Re 4 -_ gee dle : the pect string is a prbinchcome .”) viel (8 Re ty ° ? Rs. ‘input Shing & raf 9 pollindhone.”) O Cre a shetnp : radar ih, ° ° the input string fa palinchheme « 1® Oden a shiny t hello Ane input Sheeing 8 nat a palindkomne »Curie ae Presyram te Count rumbr of ibanacte ns re chang. Te Ka I= en inpt = Wrpck (“Gtere a shag: ”) chanacten — Court = fenluser — input) pak + fla number of chatcactons in -Ha sheng its {character cork} ”) Oudpet :- Cuter a string : Helle, worlel | Ra number of clascactert tn te she at teia toe Te piftte «Yon Fepriiany Fe campanen aa tos hy, eb: ham - dnd = = tee oe a stig”) sua = imped (“ lane arctan shaky 2") a Compare. — sha C shat, S12) oe i shel == sho: return Ake steclogs abe equal. ” refi © Te strdyps ane not equal,” Lop ct Onder. a she Hy name J dlocls | Pdr anollan ihn shay? varne ch Ghat Ane otitogs ark F gach: else 5 q she “Hell ja, World|” sf , 5 pain Python (ten ces yey ot fe 5 shulingh 08ile : ey ie team te cheat ay annay & ued clernents of 4 nee “y p t Sutghame~ yy AAL my 2 Yo [toa gud Cc Elements of Her ao %) fer element fn on — Wray : print (e lerrect-) Oud ody ‘heed of ee icrey !Py tha: the tap hagem so cradle a dit & ‘ho Ha t= nytt = [i Eee <] it CS List Contesades 9 wl? List contents : fi,, 34, c) X= sy List) x teak yo- jee Oy then Prepteam te perform operand on qQ 1 . } Pes hea 2 my - fist=[1,2,3, 4,5] pect: (%f. Acc ting clernents by tinder t ”) pit (" Rivest elements”, my Hist(o]) PEC. Lett efoments », my List [-1]) Hind (“[n2. Modifying elemostt by tacbet® tet ns Moding elemtnts ty fades 9 pabct (“Updated List: any List) hid C8 (ng. Ap ending an’ ferent? ®) ™ bist. appen (c) print (« Updated List? ”, my List) ‘Pran( \n4. Tnsenting an element: ”) ny List, rine bs) Hit (“Updated Lists”, any His . Poke Remouiy an elernenct by values :”) PT my “Opd (st? ; mye . > Paice Cine, Removing an element by indlens ”) wale ae y git mg tis |prdeh ("\n7- Pinding tte tudee cf an elertats ) Fidler ~ my List. in dese (=) : oid CO Pole of 5", fucker) pred (In 8. Sorting tha List: ) wy- Lis sort pra (seded fist: 2s my-dist) Qt (Ing. Reversing tte Sit”) my List. keverseO print C* Reversed lists "my dist) epee Oalpat 1 4. Aecessng elements by fucker: a : rest element? 1 Last element! 5 a Modifying elements by index! Upddect Wal. [12,10, al] 3. Dope ncling an element: Updated Gist [02,1045 é] 4. Ingorbing an element? Unde EY L120 014,55 J & Reroute an element by value? Updated lish [1,2,7, ie od CG. Removing an element by tnelere + ae st : ae é] 1. Rinding the tndee of a lemevgf- Tudlee of rss ¢ "ems 8. Sorting the ists swrldd th : | iC re] 4. Reversing the disk: Reversed ist: [10, 1,6, 551]
, ip 4p nang’) enter (ple 2 styple ) ae “gt > faple Gin, apple Do banana) 7 i Python Prxostcarm de perform operdtins ontuple + Beggar rate = (62,3) ie suplaz C “apple”, banana’, Celern “rts Oreaiucd Wople Le? ren it Cort Role 21% tuplea) lee ty, Ie fea weer a I oer eft Bag fT Goetechd ple _ In Rope ehed faples , reeperteel_pdupl Pad CeIn Ohmerte fs wip on bites let UT) pad Berns tom fade 409m Solon, tpl 4 . Keple 23 », tuple i3}) 0 C\nlen of 4 “Teple 4 fs , den (gles) pert (Le q “Tepe a5”, Ten (4uple)) wee (ais ef i nls “banana? present nh lea?” “banana ty typ) Mi ("| Pe reat Thrcongl elemerck of ® fer: yr % elemenk 5 mtu lets f prt (element) saith = (a, &Q>) (* Ong Ruple to be deleteds”, def tupk ) Hdl f ’ ~ tuple‘o uch 3 Origine! Tapled-? (23) “Ondptaal Gpler® Capple’ danam’, Schoay”) concabenated Maple 1(142,3, “apple's “bansne’, “elersy") eperted Repl i i 1,2,3) Cle merch at frokx 2 Sn Japlett 2 Ele meres -{kem ‘nde 4 mae A “plea: Cbanaad, hay) Length e ‘Tepkt 23 Length of Rplee as fs * banana’ preset in ‘ple e ? feu Plenty Horough elements of Maples: U a 3 Orgpinal “ple do be deleted + (ie, ‘?)Forte Tyllen Thejtam ta pofoimn eperdiod nr olickionay-| — Eee mee et o fet {Shame ‘shac he, Sag? 20, ity: Dame h' neck (“Orginal Dichronare on ated) 2 . J Ah ("[nflecessing vaduc of tage’: ve dt ‘47e') et (ye J = er Prick (\n Mad ified Dichiowary:™, dict) . dich Peccupndion] = ‘Engineas? Le print (« | |: -Voluc puk*, In Dichornary ofien add ny ane Hey ey roamoved- value = olich pop 6 teity’) | pet (In Dichinary Her amoung Scity’:” fict) PEC Remaved valuas”, temauec/—valae) pat (Wn Ps a € aq key Gn tts clicHenary 2”, ‘oye! on dd ppc C\y Herehing thicogh keys & ustuor 2”) | Yor bey, valu ‘th dict, Homs’0)! prcick Cf "fey: § valas}”) dick clear O yon Tak tadichlonsry alten cleoriuy all items , olict) Oxdpecd t- | drdinal Bictonacr: frame: Shecls?, age? 20, city": Damned? | Receasing ual of ‘ayes 2620 | Hocli[icol Dieticnasey fname! “shecle Cares a, (eit Dame’? ve an Hem cli seco hey, valores, fds eae Die onary aflen edly a nero Rey vate patti} tname?+ ‘Shacks? : ‘gear, Ceity Dame, fe ccupstin’ ta’) after be meet ‘uy of ‘name’ ‘Sharla | ages 21 'eceu sh bard by damsh (ophucer’? Gs (ap? a hey be vcke the dletonary ie MY, . cl 0 . Mevchiny Wehewuph keys ¥ values: nang, 5 wha cls Jes at - Oreupafions Crgireer eo Pidfonary ofc ch easabey — abt iftasg + {3 pe fro. 1be aWate Pplhon Taapham te. TAlauee angle | Cin depice) by fo & Rewg an! —~ Gmport mal def calervlacte angle (siole-a, stole 6)? i, stdeig Mo ob sole b
)IF Urbke a Pylon Thapar te final Suck The Jacked | a jiven number. | + Tespkam t def factorial (n): | Wp n==0 oh n==l: \ ted arn 1 else: techn nt Lactinial Oni oe WF (Speck ("Ccten a number 4e [ined He hcterinf: ) iL numcos Pret Garon: Pactondel fe nath efined for ongadi the + Numbers. ”) result = factorial Gan) print (4 Gy factorial of frum} is § FE Odo Oster a ee te find its pfeil se Ge factorial of © & 120. fegelty ')2 Write a Python Teopram te disply Pibonaceld sexes jusing Reauufen. 2 phim :— 4 fibonacei (n): if n<=0; refivrn "Pleate enter a postive inte pex.” eli. nee: tot [o] elif na=2: a tafigen bo, i else: 4ih-serieg = fibenace’ (n-1) fib - Sous, app tnd CH _sorieg [-] 3: fib sexes [-2]) ; gotion [ih sesces um —termé= tect (pu Cater “tte number terme a tre Rhonaced senfeg: ) alt= Rbonace? Crum terme) Mid (4 fibonscel sects esith from terme} termes” resul) Output — Oe the amb, teamy for ae Prhonaced SOE 3 Cibonacet senk cath '8 terms ': Lo, S524, 5 8, 23] 4 | T ow
You might also like
Python Unit-1
PDF
No ratings yet
Python Unit-1
17 pages
Python Notes Handwritten
PDF
No ratings yet
Python Notes Handwritten
25 pages
Chapter 2 Python Fundamentals
PDF
No ratings yet
Chapter 2 Python Fundamentals
33 pages
problem solving and python programming
PDF
No ratings yet
problem solving and python programming
34 pages
PDS Komal Ma'am Assignment
PDF
No ratings yet
PDS Komal Ma'am Assignment
22 pages
Revision Notes - Chapter 2 Python Revision Tour 2 - CBSE Computer Science Class 12
PDF
100% (10)
Revision Notes - Chapter 2 Python Revision Tour 2 - CBSE Computer Science Class 12
12 pages
pps unit4
PDF
No ratings yet
pps unit4
34 pages
1696123699200
PDF
No ratings yet
1696123699200
73 pages
Python Programs
PDF
No ratings yet
Python Programs
25 pages
PHP assignment 2
PDF
No ratings yet
PHP assignment 2
10 pages
DocScanner 29-Oct-2024
PDF
No ratings yet
DocScanner 29-Oct-2024
37 pages
Python Journal
PDF
No ratings yet
Python Journal
25 pages
Scan 24 Nov 23 13 05 34
PDF
No ratings yet
Scan 24 Nov 23 13 05 34
30 pages
Computer Science Practical Amit Bikram Mishra Class Xii Science A
PDF
No ratings yet
Computer Science Practical Amit Bikram Mishra Class Xii Science A
18 pages
171
PDF
No ratings yet
171
16 pages
Python Notes
PDF
No ratings yet
Python Notes
49 pages
Scripting Languages Unit - V Handwritten Notes
PDF
No ratings yet
Scripting Languages Unit - V Handwritten Notes
37 pages
python assignment 3
PDF
No ratings yet
python assignment 3
9 pages
Python Lab Notes
PDF
No ratings yet
Python Lab Notes
26 pages
Python Programming KNC-302 PUT Sol ODD Sem 21-22
PDF
No ratings yet
Python Programming KNC-302 PUT Sol ODD Sem 21-22
22 pages
DSC Notes Module 1
PDF
No ratings yet
DSC Notes Module 1
56 pages
Python Record A
PDF
No ratings yet
Python Record A
24 pages
Chapter 2 (DS)
PDF
No ratings yet
Chapter 2 (DS)
50 pages
Python Assignment 1
PDF
No ratings yet
Python Assignment 1
15 pages
72fb2675-6290-4c54-b10f-a9d2d59c8230
PDF
No ratings yet
72fb2675-6290-4c54-b10f-a9d2d59c8230
22 pages
Hand Written File For Computer Science Student
PDF
No ratings yet
Hand Written File For Computer Science Student
25 pages
Python Alok
PDF
No ratings yet
Python Alok
23 pages
Python ? Handwritten Notes
PDF
No ratings yet
Python ? Handwritten Notes
73 pages
Python Handwritten Notes 1701013067
PDF
No ratings yet
Python Handwritten Notes 1701013067
73 pages
PDFReader_20250216_0009
PDF
No ratings yet
PDFReader_20250216_0009
5 pages
Cremesc16 Minnie
PDF
No ratings yet
Cremesc16 Minnie
8 pages
Python Cheat Sheet PDF
PDF
No ratings yet
Python Cheat Sheet PDF
26 pages
python notes
PDF
No ratings yet
python notes
25 pages
class 12 cs practica
PDF
No ratings yet
class 12 cs practica
53 pages
Array - Notes
PDF
No ratings yet
Array - Notes
24 pages
Python Practical 6-11
PDF
No ratings yet
Python Practical 6-11
15 pages
Cheat Sheet
PDF
No ratings yet
Cheat Sheet
2 pages
Python Handwritten Notes - 1 To 2
PDF
No ratings yet
Python Handwritten Notes - 1 To 2
36 pages
Computer Science Basic programs
PDF
No ratings yet
Computer Science Basic programs
25 pages
CD Lab-File
PDF
No ratings yet
CD Lab-File
15 pages
Python Photocopy Jul 18, 2023 3-16 PM
PDF
No ratings yet
Python Photocopy Jul 18, 2023 3-16 PM
34 pages
Beg Back Tracking Copy (3) 3
PDF
No ratings yet
Beg Back Tracking Copy (3) 3
10 pages
Nitu
PDF
No ratings yet
Nitu
16 pages
Python Lab Observation Part 1
PDF
No ratings yet
Python Lab Observation Part 1
23 pages
Dec 13, Doc 1
PDF
No ratings yet
Dec 13, Doc 1
28 pages
Daa 20231209
PDF
No ratings yet
Daa 20231209
63 pages
Python 2022
PDF
No ratings yet
Python 2022
12 pages
My research
PDF
No ratings yet
My research
244 pages
C++ Programming Notes
PDF
No ratings yet
C++ Programming Notes
184 pages
PPS Unit 4
PDF
No ratings yet
PPS Unit 4
30 pages
Python Unit 1 Complete Notes
PDF
No ratings yet
Python Unit 1 Complete Notes
46 pages
DocScanner 18 May 2023 12-40 PM
PDF
No ratings yet
DocScanner 18 May 2023 12-40 PM
18 pages
Functions Notes
PDF
No ratings yet
Functions Notes
12 pages
Py Ass PDF
PDF
No ratings yet
Py Ass PDF
33 pages
Python Assignment
PDF
No ratings yet
Python Assignment
27 pages
Important Topics
PDF
No ratings yet
Important Topics
12 pages
Java Strings
PDF
No ratings yet
Java Strings
12 pages
Chapter 3 (DS)
PDF
No ratings yet
Chapter 3 (DS)
34 pages
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
Python Unit-1
PDF
Python Unit-1
Python Notes Handwritten
PDF
Python Notes Handwritten
Chapter 2 Python Fundamentals
PDF
Chapter 2 Python Fundamentals
problem solving and python programming
PDF
problem solving and python programming
PDS Komal Ma'am Assignment
PDF
PDS Komal Ma'am Assignment
Revision Notes - Chapter 2 Python Revision Tour 2 - CBSE Computer Science Class 12
PDF
Revision Notes - Chapter 2 Python Revision Tour 2 - CBSE Computer Science Class 12
pps unit4
PDF
pps unit4
1696123699200
PDF
1696123699200
Python Programs
PDF
Python Programs
PHP assignment 2
PDF
PHP assignment 2
DocScanner 29-Oct-2024
PDF
DocScanner 29-Oct-2024
Python Journal
PDF
Python Journal
Scan 24 Nov 23 13 05 34
PDF
Scan 24 Nov 23 13 05 34
Computer Science Practical Amit Bikram Mishra Class Xii Science A
PDF
Computer Science Practical Amit Bikram Mishra Class Xii Science A
171
PDF
171
Python Notes
PDF
Python Notes
Scripting Languages Unit - V Handwritten Notes
PDF
Scripting Languages Unit - V Handwritten Notes
python assignment 3
PDF
python assignment 3
Python Lab Notes
PDF
Python Lab Notes
Python Programming KNC-302 PUT Sol ODD Sem 21-22
PDF
Python Programming KNC-302 PUT Sol ODD Sem 21-22
DSC Notes Module 1
PDF
DSC Notes Module 1
Python Record A
PDF
Python Record A
Chapter 2 (DS)
PDF
Chapter 2 (DS)
Python Assignment 1
PDF
Python Assignment 1
72fb2675-6290-4c54-b10f-a9d2d59c8230
PDF
72fb2675-6290-4c54-b10f-a9d2d59c8230
Hand Written File For Computer Science Student
PDF
Hand Written File For Computer Science Student
Python Alok
PDF
Python Alok
Python ? Handwritten Notes
PDF
Python ? Handwritten Notes
Python Handwritten Notes 1701013067
PDF
Python Handwritten Notes 1701013067
PDFReader_20250216_0009
PDF
PDFReader_20250216_0009
Cremesc16 Minnie
PDF
Cremesc16 Minnie
Python Cheat Sheet PDF
PDF
Python Cheat Sheet PDF
python notes
PDF
python notes
class 12 cs practica
PDF
class 12 cs practica
Array - Notes
PDF
Array - Notes
Python Practical 6-11
PDF
Python Practical 6-11
Cheat Sheet
PDF
Cheat Sheet
Python Handwritten Notes - 1 To 2
PDF
Python Handwritten Notes - 1 To 2
Computer Science Basic programs
PDF
Computer Science Basic programs
CD Lab-File
PDF
CD Lab-File
Python Photocopy Jul 18, 2023 3-16 PM
PDF
Python Photocopy Jul 18, 2023 3-16 PM
Beg Back Tracking Copy (3) 3
PDF
Beg Back Tracking Copy (3) 3
Nitu
PDF
Nitu
Python Lab Observation Part 1
PDF
Python Lab Observation Part 1
Dec 13, Doc 1
PDF
Dec 13, Doc 1
Daa 20231209
PDF
Daa 20231209
Python 2022
PDF
Python 2022
My research
PDF
My research
C++ Programming Notes
PDF
C++ Programming Notes
PPS Unit 4
PDF
PPS Unit 4
Python Unit 1 Complete Notes
PDF
Python Unit 1 Complete Notes
DocScanner 18 May 2023 12-40 PM
PDF
DocScanner 18 May 2023 12-40 PM
Functions Notes
PDF
Functions Notes
Py Ass PDF
PDF
Py Ass PDF
Python Assignment
PDF
Python Assignment
Important Topics
PDF
Important Topics
Java Strings
PDF
Java Strings
Chapter 3 (DS)
PDF
Chapter 3 (DS)