PM SHRI KV 1STC ,JABALPUR
PRACTICAL LIST 2024-25 CLASS-XII[COMPUTER SCIENCE]
Sno Program list Date
1 Write menu based program to perform the arithmetic operation :
1. Create function Add()
2. Create function Subtraction()
3. Create function Division()
4. Create function Multiplication()
2 Write a program to find the factorial of the given number. The
function accept integer value as argument.
3 Write a program using function the function returns the value
which is divisible by 4 and 8. The functions contain integer value as
argument.
4 Write a program using function to input a character and to print
whether a given character is an alphabet, digit or any other
character.
5 Write the definition of a function Alter(A, N) in python, which
should change all the odd numbers in the list to 1 and even numbers
as 0.
6 Write a program using function in python to display all the lines
from the file("data.txt") with first character in uppercase.
7 Write a program using function to count number of vowels in a file
("data.txt").
8 Write a program using function to write those lines which have the
character 'p' from one text file to another text file.
9 A binary file “student.dat” has structure [rollno, name, marks].
i. Write a user defined function insertRec() to input data for a
student and add to student.dat.
ii. Write a function searchRollNo( r ) in Python which accepts the
student’s rollno as parameter and searches the record in the file
“student.dat” and shows the details of student i.e. rollno, name and
marks (if found) otherwise shows the message as ‘No record found’.
10 A binary file “Items.dat” has structure as [ Code, Description, Price
].
i. Write a user defined function MakeFile( ) to input multiple items
from the user and add to Items.dat
ii. Write a function SearchRec(Code) in Python which will accept
the code as parameter and search and display the details of the
corresponding code on screen from Items.dat.
11 Given a binary file “emp.dat” has structure (Emp_id, Emp_name,
Emp_Salary). Write a function in Python countsal() in Python that
would read contents of the file “emp.dat” and display the details of
those employee whose salary is greater than 20000
12 Write a function SCOUNT( ) to read the content of binary file
“NAMES.DAT‟ and display number of records (each name
occupies 20 bytes in file ) where name begins from “S‟ in it
13 write a python function of the following information into
product.csv. assume that following info is already present in the file.
pid, pname, cost, quantity
p1,brush,50,200
p2,toothbrush,120,150
p3,comb,40,300
p4,sheets,100,500
i)wrte_data() ii) read_data 3)search_data()
14 Write a menu-based program to add, delete and display the record of
Employee to perform the basic operation on stack using list in
python. Record of an employee contains: Employee Code,
Employee Name and Salary.
15 Write a menu-based program to add, delete and display the record of
Hotel to perform the basic operation on stack using list in python.
Record of a Hotel contains: Code, Name of Hotel and no of room.
16 Write a menu-based program to add, delete and display the record of
Exam to perform the basic operation on stack using list in python.
Record of an Exam contains: Eid, ExamName and Result.
17 To write a Python Program to integrate MYSQL with Python by
inserting records to Emp table and display the records. The
Employee table contains the following records: [Eid, Ename,
Gender, Salary]
18 To write a Python Program to integrate MYSQL with Python by
inserting records to Student table and search the records. The
Student table contains the following records: [Sid, Sname, Gender,
Fee]
20 To write a Python Program to integrate MYSQL with Python to
perform the following operation on Doctor Table . The Doctor
contain the following data:[Did,Dname,Age,Gender,Salary]
1).Insert Data 2)Display Data 3).Modify data 4)delete Data
21 SQL Table-1
22 SQL Table-2
23 SQL Table-3
24 SQL Table-4
25 SQL Table-5