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)
13 views
Computer science class 12th practical file
Practical file computer science
Uploaded by
alluprabhat123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Computer science class 12th practical file For Later
Download
Save
Save Computer science class 12th practical file For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
13 views
Computer science class 12th practical file
Practical file computer science
Uploaded by
alluprabhat123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Computer science class 12th practical file For Later
Carousel Previous
Carousel Next
Save
Save Computer science class 12th practical file For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 29
Search
Fullscreen
INDEX | S.NO AIM DATE Page sign no. 1 Write a python Program to take | 11-04-24 | 04 input for a number , calculate and print its square and cube? 2 ‘Write a python program to take | 19-04-25 | 06 input for 2 numbers, calculate and print their sum, product, difference 3 Write a python program to take 04-25 |07 input for 3 numbers ,Check and oe print the largest number? 4 ‘Write a python program to take | (4-05-24 | 08 input of 2 number and an operator (+,-,%,/). Based on the operator calculate and print the result. 5 Write a python program to take | 1-05-24 | 09 input for a number and print its table? 6 Write a python program totake | (9.(7-24 | 10 input for a number and prints its factorial. 7 | Write a python program to take | 11-07-24 | 11 input for a number check if the entered number is Armstrong or not 8 Write a python program totake | 19.97-24 | 12 input for a number and print its factorial using recursion. 9 Write a python program to 23-07-24) 13 display Fibonacci Sequence using Recursion. 10. | Write a python program to reada | ()3-08-24 | 14 file named “article.txt”, count and print total alphabets in the filesWrite a python program to maintain book details like book code, book title and price using stacks data structures? (implement push(),. pop() and traverse() functions) 14-8-24 Write a python program to maintain employee details like empno,name and salary using Queues data structure? (implement insert(), delete() and traverse() functions) 21-08-24 Write a python program to read a file named "article.txt", count and print the following: (i) length of the file (total characters in file) (iitotal alphabets (i) total upper case alphabets (iv) total lower case alphabets (v) total digits (vi) total spaces (vii) total special characters 24-08-24 Write a python program to read a file named "article.txt", count and print total words starting with "a" or "A" in the file? 29-08-24 21 Write a python program to read a file named "article.txt", count and print total lines starting with vowels in the file? 04-09-24 22 Write a function to insert a record in table using python and MySQL. 10-09-24 23interface Write a function to display all the records stored in a table using python and MySQL interface. 15-09-24 24 Write a fanction to search a record stored in a table using python and MysQL interface. 07-10-24 25 Create a student table of a class that contains the record of a student who scored maximum marks in a particular subject using CREATE TABLE and INSERT command in SQL. 09-10-24 26 20 SQL alter table 22-10-24 27 21 UPDATE query in SQL 26-10-24 28 22 ALTER TABLE RENAME column 12-11-24 29 23 ALTER TABLE DROP column 20-11-24 30Aim: Write a python Program to take input for a number , calculate and print its square and cube? Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM output: RESTART: C:/Users /abc/AppData /Local Programs /Python /Python37-32/Caleulate square and cube py foAim: Write a python program to take input for 2 numbers, calculate and print their sum, product, difference Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM t(input("Enter Ist no ")) ot(input("Enter 2nd no ")) s=atb p=a*b itla>b): d=ab els print("Sum = ",s) print("Product = print("Difference = Enter 1st no 5 Enter 2nd no 2 Sum = 7 Product = 10 Difference = 3Aim: Write a python program to take input for 3 numbers Check and print the largest number? Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM ‘at(input("Enter 1st no ")) int(input("Enter 2nd no ")) c=int(input("Enter 3rd no ")) if(a>b and a>¢): m=a else: if(b>0): m=b else: Enter 1st no 12 Enter 2nd no 13 Enter 3rd no 14 Max no= 14Aim: Write a python program to take input of 2 number and an operator (+,-,*/). Based on the operator calculate and print the result. Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM a=int(input("Enter 1st no ")) (input("Enter 2nd no")) nput("Enter the operator (+,*,/)") mi print("Product = ",¢) liop=="-") it(@>b): cab cbse caba print( "Difference = ",¢) lit(op=="/") c=a/b print( "Division = ",c) else: print("Invalid operator") Enter Ist no 12 Enter 2nd no 2 Enter the operator (+,-,*,/) / Division = 6.0Aim: Write a python program to take input for a number and print its table 2 Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM num=int(input("Enter any no ")) while@<=10): table=num*i print(num," * " irit1 Enter any no 5 5*1=5 5*2=10 5*3= 15 5*4= 20 S oureur | 5*5 = 25 ee 5 * 6 = 30 Ss 5*8 = 40 5*9= 45 5 * 10 = 50Aim: Write a python program to take input for a number and prints its factorial. Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM n=int(input("Enter any no ")) i=1 f=1 while@<=n): Ai 1 print(""Factorial = ",f) | OUTPUT Enter any no 5 [Factorial = 120Aim: Write a python program to take input for a number check if the entered number is Armstrong or not Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM n=int(input("Enter the number to check :")) al=a s=0 while(n>0): d=n%10 s=s+(d*d*d) int(a/10) 1. ifs print("Armstrong Number") else: print("Not an Armstrong Number") | oure\ Enter the number to check : 12 Not an Armstrong Number (Alternate OUTPUT) - Enter the number to check : 153 Armstrong NumberAim: Write a python program to take input for a number and print its factorial using recursion. Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM coo, #Factorial of a number using recursion def recur_factorial(a) ifn return a bse: return n*recur_factorial(a-1) #for fixed number ‘num = 7 #using user input ‘sum=int(input("Enter any n0 ")) Hcheck if the number is negative ifnum <0: print("Sorry, factorial does not exist for negative numbers") elif num == 0: print("The factorial of 0 is 1") else: print("The factorial of", num, "is", recur_factorial(num)) ‘ourpur- | Enter any no 5 The factorial of 5 is 120 15Aim: Write a python program to display Fibonacci Sequence using Recursion. Software Used: Python IDLE Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM LODE} der recu_fibo(a): asst return n else retusn(geeur_fibo(a-1) + recur_fibo(a-2)) terms = int(input("Enter upto which term you want to print")) check if the number of terms is valid if (aterms <= 0) print("Plese enter a positive integer") else: print("Fibonacci sequence:") for in range(aterms) print(recur_fibo@)) Enter upto which term you want to print2 Fibonacci sequence: 16Aim: . Write a python program to read a file named “article.txt”, count and print total alphabets in the files Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM {output | : Hello how are you 12123 bye total lower case alphabets 17 v7Aim: . Write a python program to maintain book details like book code, book title and price using stacks data structures? (implement push(,. pop) and traverse() functions) Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM def push(): beode=input (“Enter beode ") btitle=input ("Enter btitle ") pricesinput (“Enter price ") ‘bcode,btitle,price) book. append (bk) def pop() if(book==[]): print (*Underflow / Book Stack in empty") else: beode,btitle,price=book-pop() print("poped element is ") print("beode ",beode,” btitle ",btitle," price ",price) def traverse(): if not (boo! nelen oe) for i in range(n-1, print (book{ i}) 1) else print ("Empty , No book to display") hile True: print("1. Push") print("2. Pop") print("3. Traversal") print("4. Exit") 18traverse() elif(ch==4): print("End") break else print ("Invalid choice") 1. Push 2. Pop 3. Traversal 4, exit Enter your choice 1 Enter beode 101 Enter btitle python Enter price 254 19Aim: . Write a python program to maintain employee details like empno,name and salary using Queues data structure? (implement insert(), delete) and traverse() functions) Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM add employee delete enployee traverse / display all employees exployee=[] def add_elenent() fempno=input("Enter empno name=input ("Enter name salzinput("Enter sal femp=(enpno,nane, sal) ‘employee. append (emp) def det_elenent() if (employee==[1): print(“Underflow / Employee Stack in empty") else! ‘enpno,nane, sal =employee.pop(0) print(“poped element is") Print("empno ",empno,” name “,nane," salary *,sal) def traverse(): if not (employee==[]) rnslen(employee) for i in range(@,n) ees Mintlenployeet iD) print("Empty , No employee to display") while True: print("1, Add employee") ("2 Delete employes") 20print(*3. Traversal*) print("4. Gee") heint (nput("Enter your choice “)) if (chen) = 344_element() elif(chse2) ‘del_element()3 elif (eho=3) traverse() elif (chee) print ("End") break else: print("Invalid choice") 1. Add employee 2. Delete employee 3. Traversal 4. Exit Enter your choice 1 Enter empno 101 Enter name Amit Enter sal 45000 aAim: . Write a python program to read a file named "article.txt", count and print the following: (i) length of the file (total characters in file) (ii)total alphabets (ii) total upper case alphabets (iv) total lower case alphabets (v) total digits (vi) total spaces (vii) total special characters Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM break elses Splesplet prine(“total alphabets 2) Prine(“total upper case alphabets *,ua) prine("total special cheracters spl) # function calling count) 2welcome (total (‘total (‘total (‘total (total (total to cbsepython. alphabets *, 19) upper case alphabets ', 1) lower case alphabets ", 21) digits *, 0) spaces *, 0) special characters ', 22) 2BAim: . Write a python program to read a file named "article.txt", count and print total words starting with "a" or "A" in the file? Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM Amit Ankur and Ajay (“total words starting with ‘a’ are ", 4) 24Aim: . Write a python program to read a file named "article.txt", count and print total lines starting with vowels in the file? Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM Line 1: amit Line 2: owl Line 3: Eat apple a day and stay healthy Line 4: Anmol 25Aim: . Write a function to insert a record in table using python and MySQL interface Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM def insert data) ‘teake Input for the details and then save the record in the databse nport myaql.connector {go = mysel. connector: comect(hoste" localhost" user="root” parsword="adain") ceiacceaet int input ("Enter roll 99 *)) put(enter ane *) rCinpue(Eater per ")) cvexecute("insert into student (rol1,nane,per) values (8,36,%8)", (40.8) ei ‘db-rollback() close) fnaertdateO) 0) Record saved") Coureur | Enter roll no 101 Enter name amit Enter per 97 Record saved 26Aim: . Write a function to display all the records stored in a table using python and MySQL interface. Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM def display a1): import mysql connector o try nystl.comector.connect(hoat="localhost! user="roct" passe b.cursor() select * from student; cute(sql) countrow-e-exacute(sql) print(*nunber of rove + *,countrom) ) en beer ueea| Courur number of rows : 2 Roll No Wane Per 102 aaa 99 a01 amit 97 27Aim: . Write a function to search a record stored in a table using python and MysQL interface. Software Used: Python IDLE and MY SQL Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM {CODE | der search roit() ‘ Inport mysel connector db = mysql. connector. connect (host="localhost* urer="root*,paseuds"adnin”databare-"test") Folleint(input("Enter roll po to search “)) Cs dbceurser() venoeete(eql) . sxecute(eal) runbor of rows" countrow) Fetchadi() Pint Record dot present™) excent: ‘Besrollbeck() decloee() fearchrall() Coureur | Enter roll no to search 101 number of rows : 2 101 amit 97 28Aim: . Create a student table of a class that contains the record of a student who scored maximum marks in a particular subject using CREATE TABLE and INSERT command in SQL. Software Used: MY SQL(workbench) Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM | OUTPUT eine Name Gender Subject as 29Aim: . SQL alter table Software Used: MY SQL(workbench) Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM ono [Name Gender | Subject Warke [Sete] 7 vena pw nena 29 ma] 2 vera Ponce 7 a] z a cheney @ a] 2 = © eal 7 waa] = x F ra = wma] 6 aaa F Boe 7 waa] 7 ee PrycatEaiaton @ van] 30= UPDATE query in SQL. Software Used: MY SQL(workbench) Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM Courur | ouput Rolo [Name [Gender | Subject an | State 7 varey eras | err z vara Pose ee Go 2 sume |r crensiy a | iPass z 7a = en 7a | aren 3 eG Ti [iran $ aaa [F Boy a7___|wirPracen 7 rape [F Pyaeaiaion @ arse 31- ALTER TABLE RENAME column Software Used: MY SQL(workbench) Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM Enrotementve Name Gender | Subject | Marke 3 soma |F rer [95 a an w Eran 7% 5 7a F i § ee 0007 7 7 fapeet | F Presi acon @ 32« ALTER TABLE DROP column Software Used: MY SQL(workbench) Hardware Used: Keyboard, Monitor, Mouse , Hard disc, RAM ouput Rollo Name Gender ‘Subject 2 Vial « Payses 3 ‘Saumya F ‘Chemisty a "an w Engish 5 Rashi F Boog 7 varprect F PrysealEaucaton 33
You might also like
East Delhi Public School
PDF
No ratings yet
East Delhi Public School
26 pages
Screenshot 2023-10-22 at 11.55.08 AM
PDF
No ratings yet
Screenshot 2023-10-22 at 11.55.08 AM
18 pages
Computer Program PDF
PDF
No ratings yet
Computer Program PDF
33 pages
XII CS Report File
PDF
No ratings yet
XII CS Report File
37 pages
Computer Science Practical File
PDF
No ratings yet
Computer Science Practical File
29 pages
class 12 cs project
PDF
No ratings yet
class 12 cs project
32 pages
Python Programs
PDF
No ratings yet
Python Programs
26 pages
Final Python Journal 112
PDF
No ratings yet
Final Python Journal 112
51 pages
Assign 12th
PDF
No ratings yet
Assign 12th
14 pages
Cs Investigatory
PDF
No ratings yet
Cs Investigatory
26 pages
ram prakash (1) (1)
PDF
No ratings yet
ram prakash (1) (1)
53 pages
Computer Science Practical File Work
PDF
No ratings yet
Computer Science Practical File Work
34 pages
CS Project File.
PDF
No ratings yet
CS Project File.
38 pages
Xii Cs Practicals
PDF
No ratings yet
Xii Cs Practicals
21 pages
Pseudocodes On Number DataTypes
PDF
No ratings yet
Pseudocodes On Number DataTypes
22 pages
Programming in Python 4639304
PDF
50% (2)
Programming in Python 4639304
41 pages
python record(AIML)
PDF
No ratings yet
python record(AIML)
64 pages
Practical File XII CS 2024-25
PDF
No ratings yet
Practical File XII CS 2024-25
22 pages
Computer Science
PDF
No ratings yet
Computer Science
33 pages
Python Practical MCA
PDF
No ratings yet
Python Practical MCA
18 pages
Alpine - Cs - 12
PDF
No ratings yet
Alpine - Cs - 12
51 pages
Adobe Scan Jan 16, 2025 (1)
PDF
No ratings yet
Adobe Scan Jan 16, 2025 (1)
8 pages
Python Practice Examples
PDF
No ratings yet
Python Practice Examples
80 pages
CS018 - Python Lab Manual
PDF
No ratings yet
CS018 - Python Lab Manual
28 pages
Python Programming Lab (21AML38)
PDF
No ratings yet
Python Programming Lab (21AML38)
31 pages
Class 12th Activity File Computer Science New
PDF
100% (1)
Class 12th Activity File Computer Science New
32 pages
practical 2024 (1)
PDF
No ratings yet
practical 2024 (1)
45 pages
Practical Assignment Xi SC (CS) - 2022-23
PDF
No ratings yet
Practical Assignment Xi SC (CS) - 2022-23
8 pages
cs practical_merged
PDF
No ratings yet
cs practical_merged
51 pages
Python Manual
PDF
No ratings yet
Python Manual
22 pages
Xi Program List Term 1
PDF
No ratings yet
Xi Program List Term 1
20 pages
CSE3011_Python Programming_List of Experiments
PDF
No ratings yet
CSE3011_Python Programming_List of Experiments
3 pages
Adjusted_Python_Lab_Solutions
PDF
No ratings yet
Adjusted_Python_Lab_Solutions
4 pages
Artificial Intelligence Lab-3
PDF
No ratings yet
Artificial Intelligence Lab-3
36 pages
CS Practical File 3
PDF
No ratings yet
CS Practical File 3
18 pages
Lavender Buildings Social Media Report (3)
PDF
No ratings yet
Lavender Buildings Social Media Report (3)
44 pages
Project
PDF
No ratings yet
Project
44 pages
Computer File
PDF
No ratings yet
Computer File
19 pages
Raksha Xiics Practical 2022-23
PDF
No ratings yet
Raksha Xiics Practical 2022-23
53 pages
3 CS Practical File PYTHON PROGRAM
PDF
No ratings yet
3 CS Practical File PYTHON PROGRAM
48 pages
Program File Finalsr
PDF
No ratings yet
Program File Finalsr
27 pages
CS practical programs
PDF
No ratings yet
CS practical programs
36 pages
Practical File
PDF
No ratings yet
Practical File
22 pages
Practical File
PDF
No ratings yet
Practical File
19 pages
Computer Practical
PDF
No ratings yet
Computer Practical
18 pages
CS FILE 2024-2025-1
PDF
No ratings yet
CS FILE 2024-2025-1
3 pages
output
PDF
No ratings yet
output
60 pages
Cs Print
PDF
No ratings yet
Cs Print
33 pages
DOC-20250129-WA0006. (2)
PDF
No ratings yet
DOC-20250129-WA0006. (2)
13 pages
INDEX
PDF
No ratings yet
INDEX
24 pages
Abcd 1
PDF
No ratings yet
Abcd 1
53 pages
Cs Pro 1-8 - Merged
PDF
No ratings yet
Cs Pro 1-8 - Merged
37 pages
Practical 2024 25
PDF
No ratings yet
Practical 2024 25
7 pages
Pract hbhj
PDF
No ratings yet
Pract hbhj
35 pages
6-2 Homework
PDF
No ratings yet
6-2 Homework
7 pages
PracticalFile HITESH
PDF
No ratings yet
PracticalFile HITESH
29 pages
Python_Practice_Questions
PDF
No ratings yet
Python_Practice_Questions
4 pages
Practicle File CS
PDF
No ratings yet
Practicle File CS
41 pages
Tesara lond
PDF
No ratings yet
Tesara lond
47 pages