You are on page 1of 73
classmate iz = Guido yor Rossww Syntox i> - 191+ inaport pandas as pd | PADGA Pr IN |rgoge. applic xtion: -! _ GAMAIAA, BAK ng Machine lenning, | Basic voulables: Data — collection of the pacts. Ex! My narnne js poornro » How to stoae the dato " Pooana! —> string | S56 Tega Tane|Folse —> Booleaw | variables. DAA VAIUES covrbe Stored internponmry > SAGE Spaces called Variables: r aw ath = 30 -. ws 32 04% a-b =-I0 multiple operations: i 20= 6 Il. arb £200 onvorlables alb = 3) vecisiorny Making statements: | 82 iN else HIS AW iniiAg ¢ ‘ - 4 go 0UuUF and play _Sit Instde iP else MOAKS > 10! 245K _ give pracice test Get ice -aeanw. ‘ : ip ~~ - else pseudo code ig(Conditi on) £ Statements t be execated? | wopr ny oe | ove Used fo sepeot AtASK nana Himes. While; Repeats Erch« _| While loop pseudo code _ |_ While(TRUEDS, Keep execinting, statements | aad FPanctions in PAD g Annan 3 Function is Ablock of-code Which perpoums _aspediFictask: OOP concepts. | Toe suMounded withthe. pejects Mobile, inptop, bag bike, dog, cat Object have | Paopeaty Behaviow class is ® template for Aseo) Weald entities. ees paopeties Behaviour acolo mT __ *Make calls x cost KWe cantext *KBEhav10 WE *K Watch video %® Play games "CODING BUGS "NOTES GALLERY | Object TLhas o& Sspecipic template : a x objects ore Specific Instances OF ACIASS Phone WWd be the Jass 4x specigic instances Wold be the objects Baands oF phone Apple 4075) Sie SAMSUNG Nokios google. pixel ___ Teslow Appleis the brand sf Phone Which iS object op bIW -objects 4) |e! or t All having. —— DIFFAENE valnes POA PASPAHES DIFPRent valnes For BeHhavionry > By AIQOAlHamic OAPPAVACK fo SOIVE Piablenr + Step by step apprgachy ViAGoAG eae 10 Solve > problem is Known AS Algo aitan input —— Steps to be followed owrp ut Humber ¢ i fesso, | Nunnber Tp aAWrAben Lhe Odd i : i || EG gral a | Widhivad +13 Q0ls veer betAcep aetin aaae LNA QOL AL FoF ON Seth gS 2 See a pageiaies 6 ae = _s >. ae Introduchory to pythow Fraeeond openSOUce *KUs preeto download and to 4 Patho mae-coding init 7 a \\ ¥WE COV AUK OWL Code Trany ofthe 0S platpoa \ ipitis windows, MAC, LINUX TS ontect oriented * BY using tre object We ‘ car get Solmtign por Ht PAD lrrge Standard libro, THPADVIdeS MUCH. more §ADKIES Which, we Le inneed DDE - Prteqrated pev elOPrnent Envilonment ii Patho, Pacha, Ann conda, Webpage pishib Gv}. S ~ | | =) I i I | Painst(" This is pooanat) Trianon to Jupyitr notebook + kernel Cxecintes tre Programe: Ts ispooanoy = Variables: , Hie tom OX ="Pooangn! 5 * Voninbles and Datov-types in python» 6 = | i) w ‘oa isa~voriable — —? Poosno H=Nchandanr" Gas w Le > chandaw SAK A=" Gowda’ | iw og So > Gowda Data types in Python every Vooble is associated Wit thedatw) LD tntegeas (int) Tnrege values eS igat 1,243, 4, S; 100, 1000,229 Float % || a) = 160 | al | 4 100 “type (a) Sixt i x |) AL = 34 al iiegii BALE Salljod > Bly eypelav type (3.!4) — Float item J Hoat #|| al = Hwee k aus al J Tue ‘ oA) eae +ype(a) => Bool # | Al =" Pool al J !Pooann' +4pelar) SN x Complex NUurnbau- Botn Real and y on Al= 6ta3 Seng nna PE S al | classmate || Ratt metic opi ntos REIAHOWA| operarntor logicnl openctos. « % ¢ i | We can prporw vartous types oF epee | bg wsing above mentioned operators. Aaithmerc apernpor A A=lo b=20 Axritamehe on Mathematic operations (4, = 7 *1) Aatb —> 30(10+20), a—6 —> -0(10-20) | bas ba —>_10 (20-10) eb 3 200 (10%20)_ a8 —) 6:5 (10/20) > We Showld use pounond slash Relational a | 2>b —>False, b7a —>) Tae (20710) ta a Tune (either one valne. having bla— Tawe (ais Huey Ol) seh = AlA— Tne (both the operands AE HU bI6 —> Faise sal classmate. ——_ +s _ |, Tokens in python aon ohent |_Srneliest Mensing FLAl Component in ou proqaarn, aml _ a _|| Keywordsivori) oaisie seta ~__ || eaentpiens || Literals | operators QO) Keywoads a — me Special aeseaved woads te = || TRI give Menningewnl Drnfoanvextion for the Compiler or Trteaprerter. 3 Y i False class Finally is Return None Confnne For _ lambda TAY Bp | akce der Pion | Nonloc |! While _ and del Globo} Not. Wi AS elif Ee On 6 gield @)| tdentigiens. zs | KE NoMNES Wsed For Voninbles, puncHons = - q or objects Rules — : No Specinl character except — (Identifiers) TderntFies ove case Sensitive. Fast letter Cannot be adigit E Poorrno iS his DcentiFite ce | _Poorno is being rdentified by Wis name _ CODING BUGS NOTES GALLERY @)| Python literals =) Constants in pythory (peneh ches Al = "Pooanc! brs a Sing liter = Latisavoriable : A= 123 —D Numuic fitrant < A= TALL —> Boolean i HAL 3 Staings in python TP ME Seyence OF ChanrncraAs eEnclos Within Single quotes('!) dowble aan Gs ox MEIES qwotes (Mi HD "Hello Woald ! " This iscpoorana" .. "Tan Going tO KEADIA tomoAnOW Mt b] =!Hello woald' bI— THelio World! « 51 =" This is pooANK” bi=> | This is poornos bI= "This iso multiline. StAing Ky) classmate “Extancting+he Drdividual CHORACHAS) ae —— é _Trdexing in pyrhor SHAS With 0, nobly 012.3456 89 01UZMISIs 4 _My- Stating = "My — name — IS — POO z AEG ASH B=(2 nome sis ei Now T want poornow my-staing (1114) >! Pooanay 2 eels St J* 290200’ reno sting) lH Replacting | OA SUBSHUAG my _sruing eaeplace ("ya") —'ma name is pooare. i NUrnb er of occ uweirences oF SWb STING New Staring = "hello Hello hello World" hew-~ string, count (“helio'D =S 5 eS Finding the Index of subshtin 4, VtilW 2A s\= “Tis is Pooara! St Find (" ae y — B \ : tA SpUHINg av sting. Fawt =" Lifee applies; man ANG eS) banano. Chemies"! i Patt. split(l, "> es Sfiriice apples’ Mangoes';'banonc!,! a @ Tuples in python cae classmate, ——__> ) Bote (7 Page aS Dortov “Stawmctmes inpythonw Txaple (Los Hi DIcHornony _ set [Tuple | - Bis ar oadered col \ectary oF elements enclosed withtry () % Twples are Innmutable a ONCE You cAeate the Maple, Sf OU AE RPA ELEYSIN ET | the valine inside te taple ¢ * HeteLogenous mixtwe of diffuent elements: HETuple = ; © tpl = (100,;" bi", Tawe, cl, False) - tarp] —> (100, Ie!) TAne, 'C) False) | type (bup)— > faple: ‘ oa Extanct Individual elements ‘ ome +upilo] 100 tupili)—'b! Hupif-iJ—> False { chercitiallinds apiliig]— tb! ave api [2] —= "hello” We will geroror" haple! object doesnot SUPPOAb Ite assignment , Finding lengt~ of Txple papi = (100;"b", Tanne, WC, False) len(typ) > S ‘re Concotencting Faples ee at cp =ci2is)) = tup2 = (45:6) lL tuplt+ fap 2 (1213, 4 51 6) Repeating Twple elements tpl = (!Pooana'!;300) tapixd = (Poorna', 300, 'Pooana, 300,! PooAna!, 300) , Reapecting and Concarenahing tpl =(' Pooana', 300) HapintGyjs}6)>"s~aT laa Auplh3 + tupr : os) — (!Poornw,300,'Pooanc'; 300,'Péoano! 300 Tupie Funchons. Minimun value I apl=(1213,4,5) min (typi =! VAT classmate. —&, fest in Supe ist is on ordered collection of elements is | _endosed within 0) _# lists ne mutable We Coradd, SnbrAct, multiply. values __insidetre list. UEC" Pooano, 3:14, Trane, 5495) ee Sst th * leanne Individual elements | (ub sai. ; [ulitu) ['pooane! 3.14, Tare] * Modifying alist Changing the element a oth index HEL lal. 2 Ml 3,"cr] | Siemens) 7aL00 ia | EROS AY 2 ES es Appending anew element =e fiat, 25 tb", 3e%d) . | UU. append ("paras z ie u ' od SS [1la', 2,'b', 3,'c! 'Pooma) + Z | Popping the last element Ss UDI tay 2, "4 3,0") U. pop) ul Sy a ee Reveastrg elements [= fitay ait see uy. aevase() u — [tet pio) 21 Pe diggin Ce Trsecting element ora specified L=L ila) 2M" meee Usinserct (1, "pooxna!) — Cl pooana, tat, 2!" acd Soating alist w=" Mango", reany" "banana'',, Lysoat () a i concatenari 1g lis ts , u=C1 239 oi s he ef NANA", fe) Vé = Q+L2 fates aye’ 2 3 AL, Yb’, kel one Repeating elements: U=Liia", tured LAS >In, Bue, In - VIO AR, I Tat, _ | Dictionary Inpythor | ra» genio || iS an wWnordered collection. oF nea valine | pats enclosed with ie Bao | Dichonory is mutable ‘ ' lads | Keng PATA A 5 Vane a pauit =fapple”; So,"bananali3o"oAang e!'4o,"peoch!: 10g _| Rape(panit) dict * EXHADCHING keys paurit =flopple!'iSD,lleananalli 30, sonatageinl eee 60g FAW vkeygs ( ) c = dict-keys (['Apple!, oannge banana’ qurowver)) KEtAocHngvalues : : in pari: Mopple"s $0, bonona': 30 Nonringe': Yo ,Nauowa" 603 || fanit.valnes() io => dict values ( (50,30, 40,60]) Purit. items) I> a! 5 ‘ dict-item S(Capple'S0)(’ bananal3a), (orange!,up)) ('cuave',60)) Adding anew element — aut = apple! 10, Wonange'!20, "BANANA! ‘305 Faultl" mango =So : = Exnit — | ‘5 LlApple' o/'oraange':20,' Bana 130)’ MAngol: Changing an existing element paws S"Appie!s 10 , VoAmnge" 1208 pauit "Apple" ]=100 Puit— 2 'Apple!: 0, orange! 202 1A ix Fauit! =f" Apple's 10, orange": 208 PAE? = PNchomy"; 30,"Banana"! Yo = PAUits update (panit2) Poth a? PIApple'i!0 , !orange" 120, 'chorry': 30 ,'Bananaltl Popping Anelement (Removing ) part =f "Appletito "oAmnge": 20," Banca’! 3d faut: pop(orange") fiwit — > LT Apple's (0) ‘Banana! 3p. | set ts an wnoadered and unindexed Set In pythow > collectory oF clememts elclosed Witt ia & Duplicates aie not allowed in set S1 = £1 !Pooana!," Pooana', ie Elias. _ 31, "Pooano' We cor see, duplicates are not allowed in set Set operations: See x Adding a new element i S1= Pl, A", TAUS, 2," bot, Faise % Sladd(" Hello") S\ LUZ IFAISE Heo IAL tere 2 Thre is ho prOPER Sequence inset So +he Tindextng isnot possible tA sets, * Updating Multiple elements {=f Si= ZI ita", TAME, 2," Palse Stiapdate (C1o,20,30}) S13 — L110, 2,20, 30, False, lo! Es ® REED VINE an element Set prrnctons: VOT 7 oni Dont ated wap | Union and DytersecHar Seated ibe Bl ig * Wor a SVs $2133 Svinte Sai ; S229 haw MN tery Basically Gncrtennting. Siswnion(St) —> wo Sets: 71213, 1a! Ibe! 3 cu Ba | * Dntersection a 3 S12 $1,231 y Se Rade SToopimd ont nek naRAe SL235,6,4/8,9% elements beeen two Shrintersection (S2). = Pets.e ci 2 nue isis} ge tania Wastund sap SA ot trely Guy || Statement ig its ANning Sitinside else ao outand pli I @ O=10 b220 ig arb; Paint (Hovis qrearthanb") z : cul Apu an oat BET: PAint ("bis greater than a) if oobs EF ae PAInt{" Ais greater tron b") elsieny PAINE("AtS not greater tron b") Ran ais hot graenterthan b elseif 3 We will wselt wher WE Want to check ype multiple Sto | c=30 Lous _ip(@pbandg vo): : paint ("ais thegreatest'D § j lelig (boa § yc)! Fx paint ("'b is the greatest") [elses F 2 ce eee paint (" cis greatest ") :Olasfw jb at TBA, ec istregrentese OOltL Nis Gi)e Now Can Sechow canwe WselHnis | Conditional sintemen's with, Ust, Tuple ee dichonawy, tapl= (23/4) (Gitn MPD eee Lip zin tepet PAint(" 2is present in tuple) ° | = ly ae BAY, zis present intple a hale 3) tapl= (1213/4) , SDs hl gt oa Life intupl* paint (“6is present inteple) cise? print('éis not present intrple") Bur y 6 is not present intuple AS ed ri ig uCs=2- ee i ufJ=upj+i0° u—> Ly, 102 3,45 i *) U =[234.5) ig uCyjJ==!0% oe ufJ= uf ]+ioo elses a] u(y) = uLy) +500 ee) s[v202/3/ 41508 J Tp with dicionow yk or te diC"bYJ ==2: di[tb"] =di["b"] t00 dl — flat, 'btndr, (c's BR | classmate | A Cae Cy) | LOOPING STATEMENTS ZN PYTHON: _used to Aepeat a task multiple times, —_@) wWhileloop= a1 re {ent while loop | Syntox while condition | J | Execute stattments | «| f= es Twhile Tei0; 4 = l Paint i> é | ae) pas i= -g— a eS = __|| Nee scale > BER While i<=lotos 9 9 2x5 =10 BE | paint(inv "eT" xT oe 212 __all ie DK Hp i : P 2x8 216 a wrod gy 2*9 218 q a “2202 40 - DRID=: ¥ a *| UU = (n23ersd2 t=" while i slen(u): uid = ulid +100 icitl u—> Ciol, 102.103, 104,105 J FoR LOOP used t0 itewte over m perce (tuple, list: diction ong) (Foxy eat In Sequence sym Wody OF POA, oY key word a db U=[lopre! "eonann'," orange fort inut - Princ (i> : > Sita pee tele bananc OKNAG —, nested for loop = LNorange e" "blue", "qseen’] - 5 EY aha VeRoiae ‘phone*] Fortin: for dinizi — 9 ”ABNRE Book 4 palint (1) - s blue book ~~ bs NE a L Basic problems in pytnory Sr _@ check ever orodd t i Aun = intlinput(! Ente anumbert’ ")) | ig (num 2) ==0%) VAD REM oInd ee / paint (num," is even") Fis [elses G x PAINE (Ur, is odd). —) Enteranumbui Si) | Sis odd ERA NAmb e8 gis evere check positive poeqgahiv e@ on0 num = Floot(input (enter AnuUmmbert iFMNUM 20 + ‘ paint ("positive nun!) elif HAM ==0: iG PAiint (# Zero) eee ] paint( Negarive numb et) — EHher Anwmrb ! 8 Positive nUMmbew ar mo: Bro — Entern numbui-S Negative namber Factorial cpa numb: AWM = bce (Input (HEH number: ')) factorlal =! ip nann

You might also like