CLASS - 12 - English Project
CLASS - 12 - English Project
SCIENCE PRACTICAL
PROGRAMS
FOR GRADE –
XII [2023-
2024]
Prepared by:
Mr. Appan Raj D M.C.A., B.Ed., -
1
TABLE O F CONTENTS
2
EX.NO: 1
DATE:
S O U R C E CODE:
Result:
3
SAMPLE OUTPUT:
**********************************************************************
4
EX.NO: 2
DATE:
CREATING A PYTHON PRO GR A M TO DISPLAY F
AIM:
To write a Python Program to display Fibonacci Serie
S O U R C E CODE:
Result:
5
SAMPLE OUTPUT:
Python Executed Program Output:
**********************************************************************
6
EX.NO: 3
DATE:
AIM:
To write a menu driven Python Program to find Factor
using function.
S O U R C E CODE:
Result:
7
SAMPLE OUTPUT:
**********************************************************************
8
EX.NO: 4
DATE:
AIM:
Source Code:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
Sample Output:
*********************************************************
9
EX.NO: 5
DATE:
AIM:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
Python Executed Program Output:
********************************************************************
10
EX.NO: 6
DATE:
S O U R C E CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
******************************************************************
11
EX.NO: 7
DATE:
AIM:
S O U R C E CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
Story.txt:
12
EX.NO: 8
DATE:
S O U R C E CODE:
Result:
13
SAMPLE OUTPUT:
Story.txt:
******************************************************************
14
EX.NO: 9
DATE:
AIM:
To Write a method Disp() in Python, to read the lines fro
those
words which are less than 5 characters.
Source Code:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
Sample Output:
Poem.txt:
***********************************************************
15
EX.NO: 10
DATE:
S O U R C E CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
Python Executed Program output:
Sample.txt:
New.txt:
******************************************************************
16
EX.NO: 11
DATE:
AIM:
S O U R C E CODE:
Result:
17
SAMPLE OUPUT:
******************************************************************
18
EX.NO: 12
DATE:
S O U R C E CODE:
Result:
19
SAMPLE OUTPUT:
PYTHON PRO GR A M EXECUTED OUTPUT:
******************************************************************
20
EX.NO: 13
DATE:
AIM:
S O U R C E CODE:
Result:
21
SAMPLE OUTPUT:
************************************************************
22
EX.NO: 14
DATE:
CREA
TING
A
PYTH
ON
PRO G
RAM
TODoc_name of doctors who specialize
(i)
To Push an object containing Doc_ID and
in "ENT" to the stack. IMPL
(ii) To Pop the objects from the stack and (ii)
display
EMEN them.
(iii) T
(iv) (iii) To display the elements of the stack (after
STACKperforming PUSH or POP)
OPER
S O U R C E CODE: ATION
S(LIST
)
AIM:
To
write a
Python
progra
m to
implem
ent
Stack
using a
list
data-
structur
e, to
perform
the
followi
ng
operati
ons:
23
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
SAMPLE OUTPUT:
Python Program Executed Output:
24
**********************************************************************
25
EX.NO: 15
DATE:
CREATIN
GA
PYTHON
PRO GR A
M TO
IMPLEM
ENT
STACK
OPERATI
ONS(Dict
ionary)
AIM:
To Write a program, with separate user-defined functi
operations:
(i) To Create a function Push(Stk,D) Where Stack is an empty
from this Dictionary Push the keys (name o
where the corresponding value (marks) is greater than
(ii) To Create a Function Pop(Stk) , where Stk is a Stack impl
names. The function returns the items deleted from
(iii) To display the elements of the stack (after performing PUSH
Source Code:
26
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
Sample Output:
**********************************************************
27
EX.NO: 16
DATE:
CREATING A PYTHON PRO GR A M TO INTEGRATE MY
(CREATING DATABASE AND TABL
AIM:
To write a Python Program to integrate MYSQL with Python to
Table
to store the details of employees.
Source Code:
Result:
28
Sample Output:
**************************************************************************
29
EX.NO: 17
DATE:
CREATING A PYTHON PRO GR A M TO INTEGRATE MYSQL WITH PYTHON
(INSERTING RECORDS AND DISPLAYING RECORDS)
AIM:
To write a Python Program to integrate MYSQL with Python by inserting records to
Emp table and display the records.
S O U R C E CODE:
Result:
30
SAMPLE OUTPUT:
*******************************************************************************************************************************
31
EX.NO: 18
DATE:
CREATING A PYTHON PRO GR A M TO INTEGRATE MYSQL WITH PYTHON
(SEARCHING AND DISPLAYING RECORDS)
AIM:
To write a Python Program to integrate MYSQL with Python to search an Employee using
EMPID and display the record if present in already existing table EMP, if not display the
appropriate message.
S O U R C E CODE:
Result:
SAMPLE OUTPUT:
32
EX.NO: 19
DATE:
To write a Python Program to integrate MYSQL with Python to search an Employee using
EMPID and update the Salary of an employee if present in already existing table
EMP, if not display the appropriate message.
S O U R C E CODE:
Result:
Thus, the above Python program has been executed and the output is verified
successfully.
33
SAMPLE OUTPUT:
*****************************************************************************************************
34
S Q L CO M M A ND S E X E R C I S E - 1
Ex.No: 20
DATE:
AIM:
To
writ
e
Que
ries
for
the
follo
wing
Que
stio
ns
bas
ed
on
the
give
n
tabl
e:
Rollno Name Gender Age Dept DOA Fees
1 Arun M 24 COMPU TER 1997-01-10 120
2 Ankit M 21 HISTORY 1998-03-24 200
3 Anu F 20 HINDI 1996-12-12 300
4 Bala M 19 NULL 1999-07-01 400
5 Charan M 18 HINDI 1997-09-05 250
6 Deepa F 19 HISTORY 1997-06-27 300
7 Dinesh M 22 COMPU TER 1997-02-25 210
8 Usha F 23 NULL 1997-07-31 200
C R E AT E DATABASE STUDENTS;
U S E STUDENTS;
SHOW DATABASES;
S Q L CO M M A ND S E X E R C I S E - 2
Ex.No: 21
DATE:
AIM:
To
writ
e
Que
ries
for
the
follo
wing
Que
stio
ns
bas
ed
on
the
give
n
tabl
e:
Rollno Name Gender Age Dept DOA Fees
1 Arun M 24 COMPU TER 1997-01-10 120
2 Ankit M 21 HISTORY 1998-03-24 200
3 Anu F 20 HINDI 1996-12-12 300
4 Bala M 19 NULL 1999-07-01 400
5 Charan M 18 HINDI 1997-09-05 250
6 Deepa F 19 HISTORY 1997-06-27 300
7 Dinesh M 22 COMPU TER 1997-02-25 210
8 Usha F 23 NULL 1997-07-31 200
(a) Write a Query to insert all the rows of above table into Info table.
(b) Write a Query to display all the details of the Employees from the above table 'STU'.
S E L E C T * F RO M STU;
Output:
(c) Write a query to Rollno, Name and Department of the students from STU table.
S E L E C T ROLLNO,NAME,DEPT F RO M STU;
Output:
S E L E C T DISTICT(DEPT) F RO M STU;
Output:
Output:
*********************************************************************
37
Ex.No: 22 S Q L CO M M A ND S E X E R C I S E
- 3 DATE:
AIM:
To write Queries for the following Questions based on the
given table:
Rollno Name Gender Age Dept DOA Fees
1 Arun M 24 COMPU TER 1997-01-10 120
2 Ankit M 21 HISTORY 1998-03-24 200
3 Anu F 20 HINDI 1996-12-12 300
4 Bala M 19 NULL 1999-07-01 400
5 Charan M 18 HINDI 1997-09-05 250
6 Deepa F 19 HISTORY 1997-06-27 300
7 Dinesh M 22 COMPU TER 1997-02-25 210
8 Usha F 23 NULL 1997-07-31 200
Output:
(b) Write a Query to list name of the students whose ages are between 18 to 20.
Output:
38
(c) Write a Query to display the name of the students whose name is starting with 'A'.
Output:
(d) Write a query to list the names of those students whose nam
names.
Output:
*****************************************************************************
39
Ex.No: 23 S Q L CO M M A ND S E X E R C I S E
DATE:
AIM:
To write Queries for the following Questions based on the given table:
(b) Write a Query to change the fess of Student to 170 whose Roll number is 1, if the existing fess
is less than 130.
Output(After Update):
40
(c) Write a Query to add a new column Area of type varchar in table STU.
Output:
(d) Write a Query to Display Name of all students whose Area Contains NULL.
Output:
(e) Write a Query to delete Area Column from the table STU.
Output:
Output:
**************************************************************
41
Ex.No: 24 S Q L CO M M A ND S E X E R C I S E -
DATE:
AIM:
To write Queries for the following Questions based on the given table:
TABLE: UNIFORM
TABLE: CO ST
Output:
(b) To display details of all the Uniform in the Uniform table in descending order of Stock date.
Output:
42
(c) To Display max price and min price of each company.
Output:
(d) To display the company where the number of uniforms size is more than 2.
Output:
Output:
*********************************************************************
43