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

Python Lab Notes

hkhkhk

Uploaded by

Sameer Sheikh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
33 views

Python Lab Notes

hkhkhk

Uploaded by

Sameer Sheikh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 26
Name of the Experiment Dats type in pyfhen a e]o3]23 Joules fae Oo entbte Tefence ta fe Prins teking tip from Veer 2y)03)23 Ps [*3 pas 1® ° t odds py that fakes 2nor's as, Exmmand Vine @rgument—4 Paints iH Sv 24] 09) > oupes}>a ES fo enc sicoenmremnsTS) © oF eek decimal equivalent Ye Wa~= = Vin 2ufoa]23 pyjes pps 24] °3 [29 pales wap + Print loops over a Sejuence 2¥ex]@ oy os |e wep fe Print Counfdown for anambes 2+] ]22 | oufes)aa [ 1) wap to Print Sum of all Prime no- till no os 23 | D4 es/23 IG) sep to Print Sum of even to 2 oy]es/23 lo Fipenace) series til) 2 million | 12 ]s)e2 ala ©| Pe Fe demerstete Mist gpl in [iy e'foshes oufos}as Pythen « ap te Compole 70-oF chara cles, z ad Cte sia ee TAT 18_|es [esis © esp te print each Tne of eF character BINH | Oe | o: aspes 3) 4 Sfere jna dictionary le ae ai pee =" in Paton , to Find dale type. 9 oral cts he Gone eS pin Co. eee Python”) uF len] a eg be a Se. J : eer el ae (Sie = ay ‘ es OC" apple aa J ge 8 sh ple” ) “banana 2 sae i Ofer Pea nee point ( Hepec)) points Ctype Cb) Print Cbypece)) Ez Point © tepe Ca) jeter (type cx) ) ext Clype ()) pant Gece) point (Eype Ce? ) Tem CLEC Cmessisa in pain’ sete coal) Print a e Guy Meme) i ay ey) ete Geeay rice Ke class Pleat 'p for Checking X= int Cinput C! enter the me if Cola seo) 3 oe ae beint @oc, "ive allleven neeber elcemiss print Cx," ¥s a odd Numbex") r-_using a for leop wap thet print nm out decimal cris | Sats Ee Ve = ee al ‘ eee ADE pant (fro end =” 4) pstvetnod Y= 2 wife Uy ean axe? 2) 1D = aitall ott 2a) Entew Ee Un een cme Me lea , Even Nombe x enter the number — de = ree eal Numbee us) 3 0-5 08233 025 0.2 01666 O1N28 OrlDS o-ll1) 04 list = C"nello", "@ivansha" 1) S555) True] pepe = 1s 72,3, Print (type Ciist) ) a Pint Ctyte ( tepie)) Epon ale epcmnel@ulentlieh iy) Point (ist Cig) foint me lel tI) : Hb) Ain 2 ar velng x while beep the asps fhe vser for a womber , ord) trintt © Coon] dour fir fraf number fo Zero + mumbes = int Cinpof ( Menfer the number 2— wi whi fe é Number y= °) : Rint (rem ) Num = num—t w SOangn p the Numbed Va}ues dent ce coed four wiles > Lape even — eI) fn 5 : Lepoxt evo, at odd = 0 Sunn = 0 N= int (input (Y-Enter the Number >- ")) by jin range (27 ei) = Sumy = Sum + b while W>! for jin vampe (2, int Cm. sirt Ol) +4)? if. (Leaks add = add +n re break N= = Print (om — add ) as Soars | ONS net 2 ng == tna: n= ne (a oa -+ ie me ==08 a aaa 1s) ‘elses pzint (list) = elu list eke : s xelurn_o Ne inbCinpot( "Ener a Number s— ")) } n, =o ras add =0 a £ib (nine 02)? parca a nea ae add = add +? print ("sum of even No- iceepees output GLY Be a Number :- 5° (2.8 ,34 , ty mele =ss, fogue ,4e3es , (96UL asst Magoyias > lwazos | Oo ed S386; 26 Folun96 , 134903192 , WROFS? B9T8 D 2.03650 11044 | om of €ven Vo: in Fibbonaccl :- 266 581i list t= eee 30 645," anand ESE $e Mist g a [to, 26,90, +07 : aE Accerting fee é te using d Pind ( lista Co) 2 Lo foint (UISHZ0=19)) ah aon Print (Ust2 [ic] 2 Mis tt using _Stice N= (Weis /4i)s leven sndom point Cn 2: 4:24) print Caf: 227) print (nfo: 47) Print ([ #:2:-2]) pint _(_n [ #+ 1007) tt impodant ra len(n} n> append C11) n+ remevel t) s im = a n> pop () ’ m+ vevergec) n-clear() output Pog =—S— lo 4-0 Index Eres > list Index ouf of gear eer syria ; (Remarc) £5; 64d ee rarce [5:%F (8,9, J to [11213,45,6,7,8,9, 10,117 Pam Se, c, 4,8) 9, fon C 1,2, 3/4,S 6) 4,8, 3] etn eyS, 4 13/2,2 7 | No. F t= C to, 22, 36 Yo , So, be) e ity pen 2) aa ‘a 4 2a firing (Ct Ce) Point ( tC-17 Print (+L) ee te Using Slice operator. = _ pint ( t[2:5]) ‘+ point (tf 2: 105]) pint (tC! 2)]) t(aj = # At imported Juple fincHiens . ___ += Cio, 20, 30, Yo) point (lenct)) Peer lo, Jo/22) point ( Coot’ count (19) = (fo, 20, 1)10)2-2) point (index Ce) port ( index (24)) £= (2) 3°) lo, 28) point ( min (t)) pore (rx CE) ) oe) b Petia sank (3, Yo; 60, on Clo, 30, 50) Type Freon: ‘type! object ces net Support ike. ssi 4h import tuple fonctinis aS 0 ValnePror : teple .Index(m) 2. ° 4o +0 Disanshu staf Hello, Iy- Name is Divanshu . Zam porsving eTecH fem Phang eae ae “of lactic oren Code 149) import os , sys Filename = inpot ("Enter File” name 2= ?) if os, path - tefile (Filename) ¢ print (Filename , "File are exists,”) f= open (Filename , "¥") else > Pak ( Filename," File dees of exists.) Sys. exit (0) i [ine — Coon = Worf Count = Char — Cunt = 0 a a oy wlinesmnah ie tine Cot t= L Chay Cont $= [en( lines) words = lines « Split O werd — Cont t= len( verge) utp EE eile Nome 2 Dhansha tht aw 5 QDivanshu , txt file ave exisfs. Tote] nember of lines In file :- 5 Fet=| number of chavactas fn tie - us ete] Nether of Werds in file ?- 19. Een € = inpet (" Enter File Name oe i if os. paths (a eee Prat ( filename," File are exists ”) 4 = open (Fifename , "x"! ) e)se : Print ( fiJename "Fie dees net ews} iy) Sys. eal t (0) sfoy lines lo 2 pea izeots ae ee) | GO Enter File name !- Divanshy . pf Dansk fet file are exisfs. suhsnavid si eman ym, olleH a sgniveenign£ -of egellec hnitenvetn tT dnan morf heerTe gnivsvup ma TF qsuaD movrf mar Gla ass Import os, Sys = — oe |___filename = Inpof "enter fille Namer- {6 os. path, ie-file (Filename) e Print(Filename, " File are exists 1) f= open ( Filename , "vy wy) ese: : Paint (Filename » "File dues ook exisp ”) 7 Sys . exit Ce) a a fy= f 3 Pa nee Se ey ch in Nine 2 16 ch Io beg i freq [ch] = 4 else freq (chJ= 1 pit (by) tel = filename. split C*.*) Teacher's Signature * A tH isa c File. Lis Ln a iat (Gas en coal ete ee re FC ee pint (ch & Tan Ale) gee =a ee ae point ("st is o feet File. ")> alsa 55 Poiee (oe hoe) eae) Enfer file came are exisfs nowy o?7, Way Diancha. ter Files : Pome, wees Sotiris 2 er tats 9 /) nae meee oy, rt 7th" 2a et cee Pet np! 23, (R°s 2 oa pees \n OR Hels , Po 3s, 1A ay 25, eee, 't:*, I peeeue’= 1 f te et Fle ee Cop file rane 2 %¥z +P nygz-P File dees nef exists — mae P _wap fp Cont 0. of frequency in a shieg and spored itn 2 efictime = nped (7 Enter the sing 2-7) a: for i in sf : if f in feq : fe ip fin heq » keyc) fegfig t= 2 e/seys freq li = 1 Paint (Feq) oufpot, ‘ ; ee ele, fee sping - tiellos “He mee Divansh agrawe] oe re. oo en Me ase tee Bees ys 2, Nt 2, ‘a's Ft, > oo 6 fe ea © es es

You might also like