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)
29 views
53 pages
Class 12 Cs Practica
Gde
Uploaded by
dasarathitatachariar
AI-enhanced title
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
Download
Save
Save class 12 cs practica For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
29 views
53 pages
Class 12 Cs Practica
Gde
Uploaded by
dasarathitatachariar
AI-enhanced title
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
Carousel Previous
Carousel Next
Download
Save
Save class 12 cs practica For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 53
Search
Fullscreen
! © WAP in python +o show the basic fe Funafonality oy calculoter is od Gi def Add (5 ae ae EEE _ Stir =10 =e (OMY 0 while True? os - Sele fotlinput (enter ao) a oa eee es — sort Ce _ans=fnp nuk (add more 00- Sve 0") cpeeeues Me ast 50 4 break paint tsom) def svbt)* a EE Es astoitinpet enter r nol’) Pt OL o __ hie ais __azinttinput Center no) gUbs = Sube-a 0s =Tnputl want +0 Subtract more oe-)"y)n) gastn’? 2 ee break 3 i a: fat subs) pes det mutO. ie __ multe) ts while Tene (LOT nee a a= intl Cinput Center no.) no. mul = mult ta 2 pin k= pub "wont t0 mul mere 0° EB! A oe ee— _ ae Pe ovtput:-O ade/Sve/mul/div add enter no. 3 add moreno-2 Y/n Y enter no. ¢ add more 0-9 Y/n 1 81) a break _ priotCrulti) de et ovo Oe 4 ind Unpat enter no.")) divi= a a ae while True 3 Pcs fot Cinput enter no/)) _divisdtviJ/o _ eS Le C want to div more np: Y/n'') Ei in So ‘Teacher’ Signature —_____— TT2 ©) irite afounction fo python which accepts a no: from ger +0 return true i4 the 09-18 prime No. else return false: Use this funchon +o punt all prime no: from 1 +0100. dot, prime (a); for fin range (2, O//9 +1)* LEOU/ aie tO return False break else return True for 130 range (ML WONA 0 is 2 9 pmme Ct) a= prime ti) T ip oe 3 ) print i) Teacher's Signature mmm SaWrite. pene aire student ana retusns th coark and mmm is oe a Us ef 4 mowks ek @ mininum mark , Maxi room | ___maximyms maxtra) E overage = sum tm) / Len ) ee _retorn minimum, maximum, average m2 lu 040560) 40, 0 107 s Ob, 05 -anolusieém) {pa Carb, ¢ Teacher's Signaturer— S { Text File i SHRI KEN DRIMA | VIDYALAYA pu L2 i ee ee ee a eee j—}—-, Hello | I Love India | PM SHRI Kendriya. Vidyotayo ) Port ' =— = = Output? - Total yvowelg= 13 Totel Lowercase =2Q Z uppercase = 13 Consonants = a4P Oo WAP to read a textile “muff il e-txt” ond dpi +he no vowels z fovee ae. ae - a eee nner eee ih open.t'my Fite mE Zasrde) ae : dott = Elk cceadt DB} ‘ re vowel =a fouA£TOU ” famed’ = CLE Ce = 6) = —eoneinue ies alfa i t-te lower C) * _ ia oe eis c = clatours pU tC) pant (“total | yowels=',cv_,‘\torbal Lowerece =") CL, “uppercase =", CL,“ consonants =”, Cc) fr: clase) a ‘Teachers Signa i ET| How are You LI am good | B | abe | [“Hetlo\n”, “How are you\n" 5 ak oun good "Bye\n'' (“How are youn”, “Tam geoa\n" J C“Helloln", “Bye\n "J(13) 6 ae WAP +0 remove all the lines that contedn tne fe character 'a! fn a File and waite ft anothe file fiz0 en Cmytet tts oe) a a= fi-readliner() _ a retort) “d ss Vie | a G.elocet) hei i Bs Uy Sal afl ee, Stk ae z Laas Lea 4. as i aeeabiat for Sind? Lenten ie Oana z ___ly-append a) iz 7 dt) ep erd ne ep f= open Ceopytxt--xt” "eof f= open O mytat txt, S47) fy writeliner (0) £3 + wartelines (1a) Fy: close. C) f3- close)peiniticae Txt File aa writelines) © Hello Potato f¢ a yegerable Table ( ( ( piel Output— Potato iS a vegetable TableWAP to cweate a textFile and paint the lines starting with ‘T? ow 'P' (goth uppercase and lowercase) be z ae £12 operall NaN Sc setoketa 9st) Se LC" Hello/A", ‘Potato ico vegerable/y “Table/n” “bye priya/n”, “oeege i/o a ae aed Sofi write Unda ty) santa os fi -seeklo) a reader= £) - seadling: 0) ae fy closet) for 7 In weader: - i fi {& Tod 2 in“ Tete”: pot) Teacher's Signature meHe fs a good boy She fsa gist He fs ram She te e?ta He She He She He | Bye prequenty of He= treqvency of She= 4oe : meg Oe Read atext-file to prfpiithe frequent % she. ood tHe’ ond 'She’ found in the File« Fie open (Smuytxtetxt he) ee d= fi -weadtoec) jib. 2) ot eats oes 4): closet} (7 tee) | pass 0 oe eae counthe = Countshe =o att ct for 7 iod: ET eounthe t= } -count tHe") ot a countshe +=}. count ("the ) pa yrequency © Eau oeae ; ceunehe J point C Se she = + eon he Teacher's SignatureOutput <@ enter poll 4 ede enter name khushi add more? You enter roll 2 enter Name hrutike add more) Yes enter rolls enter name dhani add more N enter required roll © not found1 aOR! ee 5 na re 2 emer = sail Create a binary ffle with name and collnumber- Search fora given roll oo: and display the name, iP oot found pana ot ee 13 Lae) —— looport pick Le_ eee fl = open Cbinary. aot, ont) 4 | eh). while True, coll<= int Cipput Center oi Nome =input Menter name”) _ 1tTnamej= roll_ ans= input C'add more 9) Lyons? fn to's = break pickle. clump (t,#4)_ {i = in on er re 4, ived role) C=O i “_f1 2 open C"binosy- 1A) 2 Tao IEE load CF) _for_k,v in data. itemet)? a ——_ i yer? ss eee =4 | aa Tal essoy 4 paint (‘not found 377 boeak except FOFEN Or: #)-cl0S oe Teacher's SignatureOutput : — © enter rolino 41 ~ enter name a enter mark: 90 add more? Y enter rollno 2 enter name b enter mazks TS add more? ¥ enter rollno 3 enter name C enter marks 100 add more? h required roll no to be updated C Updected moaxrks 50 rhs teat1 ae) Create a binary File with roll no-,name and marke - loputk a coll.no- and updote the marks — impoat pickle Ma St sii Fee ee | fy = open (binary. dat", Sab) k B i= aa Ss white True: ne meee at _ rt sint Cinput (enter rollno!)) N= Ippuk pt enter name’) nee | Mae ig otc (CRE ne Trig eres ee A+append (Ero, mp Br tas iayaea(Covelel myc de) __54 Rip isn _ eae _pieklesdomp (1 £1) fi: closec) col. = Int Cinput required roll 40 be updated’) ) opdatemarks is int (input C updated marks’) trys oF = open Cbinary-dat'",Urbi" ) Beep ia imu” data =pickle- load (FD _ Se povanianineciaeaes i+ ilo == rol): rib) ec ateln as er sont totoctoe as c ‘break eX Cépt iO) Ait ora €, > close) zi Teacher's Signaturei Ananya =o Aruntyott Debanshi Output :- CV, tAbanti ka’ ley ‘Ananya’ J SS “Arunsyott”] CY’, ‘Bebansh??]Output : - userid o pascword 4 wanna add mowe rows? y/n y usertd b password Q wanna add more rows? y/n Y userid C Passwowd 3 wanna. add move rows? y/n y usertd q password a wanna add more rows) y/n n enter userid whose password you need C 3——— ee = \e Pt €a random no. generator that gene roves rand om nos: bekween 1 and b Coimulaser o dite) Thretnthel dice for lo times and patot théte total _ jmpowt random ae |foritn range (1,193 as random . randint ( 1 a 9 OO) ai ais Oa Somt= O& j print Caum) oat aaa Teacher’ SignatureWAP to python +o demonstrate neat gearch A= 11 Ree Sa one S a0) eean print (Ust fg", 95 Cease st 1 ssa a= int input ("no-to he qoarched 2")) ‘for? Pn t 3 Ga é ease i ee | ey Soe | Pesan no eee _bereak Teacher's Signatureje aa Xan < ystog data. st rineieeteanll wae to fen plement o ote stack = Le Dees, ma é def pus): by=01 9585 @ Tee _ Rigor es m 2 Stack-append tid b arnt tstack ae d nia ~ cle _Spopl ~ for 1 nlata i a as ctack-popl) ; pe pol UNE Gek semis) Mae SpopJ > Lenoth 0)? b= Len (stack) __pafat Ulength oh stack te", b) jtengunt i — Teacher's Signature eTlwae +0 pase an Piedad Ustag ‘augae Us a fonetf and push ee those elements fn the otack whith ard dfvisible oe H stack = J_ det Aiv(p)? for f fot: 6 fh ty t= = 03 —___ Stock iappendt) sa! fi paint (stack) 2 DGS eee 2° Saal) laiv( 2d Teacher's Signature " eTQuerfes _vsing iGO Net ae C fen Wem w In CA) LIE A Ce) (SDL » te) enden ae ge ee “Sele | ca) Select dictinct (pEeT) _ i rom EMPLOYEE $ (bh) Select NANO: trom EN ployee | Where EXP between © ana 45 tc) Select ROLLNO: __hrom CLASS lephere NAME In Ca’, tg?) 5 wl Select MARK — $rom, CLASS where _ a = & | 4ycom clase __liphere NANE (8 Noll 5 (f) Select ) com clase __gorder by MARK __boving ROLL between 41 and S 3 @) select count Ch) > CITY ___ trom EMPLOYEE Group by CITY 5 Teacher's SignatureOutput — © Ge arene) a wy) 2d tb) [Bvg (maak) J a pov iminitmot) | i a ce) Seem easaS Fee Queries for Agyrceagate foncHons 1— cad enmed, (b) Avg) » Coymin €), Cd) ma. xin) 5 166) ain} € i ta) Select gum (EXP) cae yom _€ MPLOYEE } Cb) select avg (Mark) From) CLASS col geloce mintmasck) __ ftom class), td) Selec max (sald | Aron EMPLOYEE § “te cetect count) _| +-rom_C1SS Teacher's Signature __| Output: — @ | Query OK, © rowsGi ee) ha? ta cannes? pythanainidn seg ala a connecty| Ay ond | er foun the to owing Loe on dat in data. bale? Cneckale erate a Import mYsal: connecter mydb = meat con: echor- connect (hosts ‘locadhost)) 4 bi passwd = 123, | aes bsername Scans Aakal bases hoot’) my Clr muydb:crpsor mycurs execute L (“ Create table clace a CROLLNO, int, primasy key ae Alame _varchar(3o) Z mack int)" ) muydb-cloce L) Teacher's Signature| Output: — © Query OK tL row affected (o-U# sec)Si oe P WAP to _coinneier Python with MyS@L using dostaboue conne CHvity and “per{oam ihe following operation on cata _in database! Ingert record in the table Mmport mysql*connector i i Ee mydb = my sq Ls connettor connect (*h oct = locathost! a username = ‘root’, _ ee Ela ener myurr = mydb-cureord) a myourr + execute ‘ Cinsert into clase Res) ale, ith e228) a mud be commit () m 4dr ¢ tose U Teacher's Signatureoutpud?- Query OK, 1 row affected (O-dbsec) rows matched 4 changed! 1. WasninasGenny. python wi aloe connate cee the {ollowing. Operation | on dot in database } mee the tav\e _ Import rngyeop.~ tconnettpy — “eannector connect Lnost = localnost), bi ____ysernome= rect! __ ae posswd s Wek ae a ear Vochoou ) _my@tours mydb: cursor O) My Cu = Ce Ces _(“Svpdake clas ¢ ae mosxk = 100 where RolLnd = 1”) reydis: commen £0 — close) Teacher's Signatureg Pa eee i _J WAP S So. a aan connect Python with mys@L ucing database of ae f Fosiro_eppmecivity. the i \ to a! dato in clakdbare! belete cocprd from) | impowh mysql sconnector mydb = mgeglscommector tonne ct (host= ‘localhost’, i SE i peername s ‘ypot! poserwds 123 = School” my aur = mydl=curcor My Cues 2xeCUre = Upebete a Dorawatu ee Wee Seooens ioe) a mudb-commtU niyo closet? Teaeherecipeature
You might also like
The Beautiful Game An Introduction To Soccer
PDF
No ratings yet
The Beautiful Game An Introduction To Soccer
9 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
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
Python Journal
PDF
No ratings yet
Python Journal
25 pages
AKU PPS Pyq 2019
PDF
No ratings yet
AKU PPS Pyq 2019
11 pages
Python Sem2
PDF
No ratings yet
Python Sem2
16 pages
DocScanner 18 May 2023 12-40 PM
PDF
No ratings yet
DocScanner 18 May 2023 12-40 PM
18 pages
Python 2022
PDF
No ratings yet
Python 2022
12 pages
MCS-011 Problem Solving and Programming
PDF
No ratings yet
MCS-011 Problem Solving and Programming
13 pages
Practical
PDF
No ratings yet
Practical
14 pages
CD Lab-File
PDF
No ratings yet
CD Lab-File
15 pages
Computer Science Unit 1 1. (Python Revision Tour)
PDF
No ratings yet
Computer Science Unit 1 1. (Python Revision Tour)
20 pages
Python Handwritten Notes?
PDF
100% (1)
Python Handwritten Notes?
31 pages
SCH - BPLCK205B June - July24
PDF
No ratings yet
SCH - BPLCK205B June - July24
17 pages
Python Unit 1
PDF
No ratings yet
Python Unit 1
17 pages
Python Notes Handwritten
PDF
No ratings yet
Python Notes Handwritten
25 pages
Lab Report 3-4
PDF
No ratings yet
Lab Report 3-4
47 pages
Computer Science Practical Notes
PDF
No ratings yet
Computer Science Practical Notes
35 pages
Adobe Scan Nov 29, 2024
PDF
No ratings yet
Adobe Scan Nov 29, 2024
23 pages
Python
PDF
No ratings yet
Python
31 pages
Python Handwritten Notes 1697407123
PDF
No ratings yet
Python Handwritten Notes 1697407123
31 pages
Cs Practical
PDF
No ratings yet
Cs Practical
27 pages
CS 12th Short Notes
PDF
No ratings yet
CS 12th Short Notes
13 pages
C++ Unit 2
PDF
No ratings yet
C++ Unit 2
46 pages
All Unit
PDF
No ratings yet
All Unit
7 pages
DocScanner 04-Dec-2023 8-06 PM
PDF
No ratings yet
DocScanner 04-Dec-2023 8-06 PM
22 pages
Python Notes
PDF
No ratings yet
Python Notes
25 pages
Class 12th Complete Notes
PDF
No ratings yet
Class 12th Complete Notes
100 pages
Data File Handling - Py Class 12
PDF
No ratings yet
Data File Handling - Py Class 12
25 pages
CP Important Question Bank Which Can Come
PDF
No ratings yet
CP Important Question Bank Which Can Come
32 pages
1696123699200
PDF
No ratings yet
1696123699200
73 pages
Module 2 Part 1
PDF
No ratings yet
Module 2 Part 1
13 pages
Crypto Lab
PDF
No ratings yet
Crypto Lab
37 pages
Cheat Sheet
PDF
No ratings yet
Cheat Sheet
2 pages
Oodp Unit 1
PDF
No ratings yet
Oodp Unit 1
38 pages
D - 52 Om Hiroji CP Assignment - 2
PDF
No ratings yet
D - 52 Om Hiroji CP Assignment - 2
11 pages
PDFReader 20250216 0009
PDF
No ratings yet
PDFReader 20250216 0009
5 pages
Data File Handling
PDF
No ratings yet
Data File Handling
76 pages
Grade 12 Comp Lab Record
PDF
No ratings yet
Grade 12 Comp Lab Record
21 pages
Python Unit1
PDF
No ratings yet
Python Unit1
39 pages
DocScanner 9 Jul 2024 10-39 Am
PDF
No ratings yet
DocScanner 9 Jul 2024 10-39 Am
17 pages
Advance Python
PDF
No ratings yet
Advance Python
10 pages
PPS EXP. NO.2 and 1
PDF
No ratings yet
PPS EXP. NO.2 and 1
8 pages
Py QB
PDF
No ratings yet
Py QB
19 pages
Python
PDF
No ratings yet
Python
17 pages
Practical of XII Comp SC Students 2
PDF
No ratings yet
Practical of XII Comp SC Students 2
30 pages
Lab 2
PDF
No ratings yet
Lab 2
21 pages
Dec 13, Doc 1
PDF
No ratings yet
Dec 13, Doc 1
28 pages
U
PDF
No ratings yet
U
40 pages
Cs Notes
PDF
No ratings yet
Cs Notes
28 pages
171
PDF
No ratings yet
171
16 pages
10 To 40 (C S Practicals)
PDF
No ratings yet
10 To 40 (C S Practicals)
20 pages
CS Record
PDF
No ratings yet
CS Record
67 pages
Anurag Python
PDF
No ratings yet
Anurag Python
69 pages
21 Program
PDF
No ratings yet
21 Program
21 pages
Namma Kalvi 12th Computer Science Practical Manual em Dhanapal
PDF
No ratings yet
Namma Kalvi 12th Computer Science Practical Manual em Dhanapal
19 pages
Practical
PDF
No ratings yet
Practical
48 pages
Python Handwritten Notes
PDF
No ratings yet
Python Handwritten Notes
41 pages
CS Practical File
PDF
No ratings yet
CS Practical File
38 pages
5 Chem 241 Am
PDF
No ratings yet
5 Chem 241 Am
15 pages
Blue Print of Pre-Board 2024-25, Sub - Physics
PDF
No ratings yet
Blue Print of Pre-Board 2024-25, Sub - Physics
1 page
Blue Print (041 Mathematics - XII)
PDF
No ratings yet
Blue Print (041 Mathematics - XII)
2 pages
Document
PDF
No ratings yet
Document
3 pages
Document
PDF
No ratings yet
Document
1 page
Practice Questions For Remedial Class (Phy Part 2)
PDF
100% (1)
Practice Questions For Remedial Class (Phy Part 2)
3 pages
Cbse Loc Ix
PDF
No ratings yet
Cbse Loc Ix
31 pages