Kendriya Vidyalaya 14 GTC Subathu
Practical List of Computer Science (083), Class XII
S.N Practical Details/Objective Date of
. Practical
1. Write a program in python to check whether a number is prime
or not.
2. Write a program to input a character and to print whether a
given character is an alphabet, digit or any other character.
3. Write a program to read a list of n integers (positive as well as
negative). Create two new lists, one having all positive numbers
and the other having all negative numbers from the given list.
Print all three lists.
4. Write a function INDEX_LIST(L), where L is the list of elements
passed as argument to the function. The function returns another
list named ‘indexList’ that stores the indices of all Non-Zero
Elements of L.
For example: If L contains [12,4,0,11,0,56]
The indexList will have - [0,1,3,5]
5. Write a function that takes a sentence as an input parameter
where each word in the sentence is separated by a space. The
function should replace each blank with a hyphen and then
return the modified sentence.
6. Write a program to check whether a number is palindrome or not
using function.
7. Write a function StuDetails( ) in python which accept a list of
marks of students and return the minimum mark, maximum mark
and the average marks.
8. Create a dictionary with the roll number, name and marks of n
students in a class and display the names of students who have
marks above 75.
9. Write a function countNow(PLACES) in Python, that takes the
dictionary, PLACES as an argument and displays the count of the
names (in uppercase) of the places whose names are longer than
5 characters.
For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"Doha"}
The output should be:
Count of the places whose names are longer than 5 characters: 1
10. Write a Python program to create a text file and write your name,
class, roll, Father’s name, mother’s name and address in it.
(Using functions)
11. Read a text file and display the number of vowels/ consonants/
uppercase/ lowercase characters in the file. (Using functions)
12. Write a program to write those lines which have the character 'p'
from one text file to another text file. (Using functions)
13. Write a program to accept a filename from the user and display
all the lines from the file which contain python comment
character '#'. (Using functions)
14. Write a function in Python that counts the number of “Me” or
“My” words present in a text file “STORY.TXT”.
15. Write a program to write, read and display employee records in a
binary file. (Using functions)
16. Write a Python program to create a binary file with roll number,
name and marks. Input a roll number and update the marks.
(Using functions)
Class XII Practical Lists – 2023-24, KV 14 GTC Subathu
17. Create a binary file with name and roll number. Search for a
given roll number and display the name, if not found display
appropriate message. (Using functions)
18. Write a program to perform read and write operation with a csv
file. (Using functions)
19. Create a CSV file by entering user-id and password, read and
search the password for given userid. (Using functions)
20. Write a menu based program to perform the operation on stack
in python using lists. (Using functions)
21. Julie has created a dictionary containing names and marks as key
value pairs of 6 students. Write a Python program, with separate
user defined functions to perform the following operations:
● Push the keys (name of the student) of the dictionary into a
stack, where the corresponding value (marks) is greater than 75.
● Pop and display the content of the stack.
For example:
If the sample content of the dictionary is as follows:
R={"OM":76, "JAI":45, "BOB":89, "ALI":65, "ANU":90,
"TOM":82}
The output from the program should be:
TOM ANU BOB OM
22. Alam has a list containing 10 integers. You need to help him
create a program with separate user defined functions to perform
the following operations based on this list.
● Traverse the content of the list and push the even numbers
into a stack.
● Pop and display the content of the stack.
For Example:
If the sample Content of the list is as follows:
N= [12, 13, 34, 56, 21, 79, 98, 22, 35, 38]
Sample Output of the code should be:
38 22 98 56 34 12
23. Basic SQL Queries to Create Table - (Two tables)
24. SQL Queries using Alter Table/ Update/ Delete
25. Select Queries using DISTINCT, BETWEEN, IN, LIKE, IS NULL,
ORDER BY, GROUP BY, HAVING Clauses
26. SQL Queries for Aggregate functions- SUM( ), AVG( ), MIN( ),
MAX( ), COUNT( )
27. SQL Queries on Joins (Cartesian product on two tables, Equi-join
and natural join)
Write following programs to connect Python with MySQL using
database connectivity and perform the following operations on
data in database:
28. Create a Database and table.
29. Insert data into the already created table.
30. Fetch data from the table using different clauses and conditions.
31. Update data according to user needs.
32. Delete data according to user needs.
Class XII Practical Lists – 2023-24, KV 14 GTC Subathu