HOLIDAY HOMEWORK
COMPUTER SCICENCE
CLASS XII
As per the CBSE curriculum, students are required to prepare two files for board assessment: the
Practical File and the Project File.
PRACTICAL FILE
1. Write a program in python using functions to check if a number is prime or not.
2. Write a function SwapNumbers( ) to swap two numbers and display the numbers before
swapping and after swapping.
3. Write a program to generate random numbers between 1 to 6 and check whether a user
won a lottery or not.
4. Write a user-defined function named ReplaceConsonants(W, N) that takes an English
word W and an integer N. Replace every N-th consonant in the word W with an
underscore (_). If N is greater than the number of consonants, leave the string unchanged.
Example: For the word "PYTHON" and N = 2, the function should return "P_T_ON".
5. Write a function triple_shift(L) that rotates every set of 3 consecutive elements circularly
to the right. Example: [1, 2, 3, 4, 5, 6] → [3, 1, 2, 6, 4, 5]
6. Write a function list_to_dict(keys, values) that creates a dictionary from two lists: one of
keys and one of values. Example: Input: keys = ['name', 'age', 'city'] values = ['John', 25,
'Delhi'] Output: {'name': 'John', 'age': 25, 'city': 'Delhi'}
7. Write a user defined function in Python named showgrades(S) which takes dictionary S
as an argument. The dictionary , S contains Name:[eng, Maths, CS] as key : value
[Link] function displays the corresponding grade obtained by the students according to
the following grading rules:
For example: Consider the following
Dictionary S={“Amit”:[92,86,64], “Ruchika”:[65,42,43], “Stephen”: [92, 90,88]}
The output should be
Amit -B
Ruchika – C
Stephen- A
8. Write a program to write lines starting from character 'p' from one text file to another text
file.
9. Write a program to count the number of vowels, uppercase and lowercase characters
present in a text file.
10. Write a program to count number of words “the” in a file.
11. Write a python program with the following user defined functions:
• add_student() to store details of student (roll number, student name,class, marks) in a
binary file.
• display() to display the details of students who have score more than 80%
• update()- to update student marks on the basis of roll number entered by the user.
• delete_student() to delete record of student from binary file if they have less than 40%
marks.
12. Create a CSV file by entering user-id and password, read and search the password for
given userid
13. Write a menu based program to perform the push details of product on stack in python
14. Write a MySQL connectivity program in Python to
• Create a database school
• Create a table students with the specifications – ROLLNO integer, STNAME
character(10) in MySQL and perform the following operations:
▪ Insert two records in it
▪ Display the contents of the table
15. Write a menu-driven program to store data into a MySQL database named shop and table
customer as following:
1. Add customer details
2. Update customer details
3. Delete customer details
4. Display all customer details
Points to remember, while documenting your Practical file:
1. Practical file should contain index listing all the programs in order of the programs given
above.
2. Every program should start from a new page.
3. Only screenshots of the code and the output to be submitted.
4. Try writing all programs on same platform i.e. if you are writing programs in visual
studio , write all programs using visual studio only. Avoid using different Python
platforms.
Students are requested to do first 9 codes from the 15 codes shared.
PROJECT WORK
As per the CBSE’s curriculum, students appearing in XII examination must be assigned and
complete a project work. The aim of the class project is to create something that is tangible and
useful using Python file handling/ Python-SQL connectivity.
Students are encouraged to visit local businesses and ask them about the problems that they are
facing. They can use a wide variety of Python libraries to create user friendly applications such
as games, software for their school, software for their disabled fellow students, and mobile
applications. The students are requested to avoid plagiarism and violations of copyright issues
while working on projects.
How to start your Project work:
Stage 1: Submission of synopsis
Students may choose a topic for their project work. You may prepare and submit a Synopsis
in 3-5 pages, including the following-
✓ Title of the Project.
✓ Statement about the problem.
✓ Why is the particular topic chosen?
✓ Methodology to be used.
✓ Objective and Scope.
✓ Process Description (Menu details, major functions to be developed)
✓ Hardware & Software to be used
✓ Limitations of the Project
✓ Conclusion
✓ Reference and bibliography.
After approval of the synopsis ,the project work may be started.
Stage 2: Plan your project
Stage 3: Develop your Project
Stage 4: Prepare a Project Report (Documentation)
• After completing the development and testing work, you have to prepare a Project
Report in 20-40 pages of A4 size paper with 1’ left, right, top, bottom margin.
• The report may include content as per the index.(shared below)
• Coding screenshots should be clear enough to be read.
• Also , word document of coding should also be attached.
The project should include the following structure:
INDEX
1. Cover Page
2. Certificate
3. Acknowledgement
4. Main Report
✓ Objective & Scope of the Project
✓ Introduction and Definition of Problem
✓ Methodology adopted/ Details of Hardware & Software used.
✓ Screen Design with Menus (screen shots only)
✓ Code
✓ Outputs
✓ Structure of Tables (Column Name, data types, size and constraints etc.)
5. References ( Bibliography/ Books/ Websites)