COMPUTER SCIENCE
PRACTICAL FILE
Session: 2025-2026.
Name: Ayush Adhikari
Class: XII-A
School: Vanasthali Public
School
1|Page
Certificate
This is to certify that Ayush adhikari of Class
XII-A, from Vanasthali public school , has
successfully completed the Computer
Science Practical File as per the CBSE
curriculum during the academic session
2025-2026. This file consists of the required
Python programs, SQL queries and project
work, and has been completed under my
guidance
2|Page
Acknowledgement
I would like to express my sincere gratitude
to my Computer Science teacher for her
valuable guidance, encouragement, and
support throughout the completion of this
practical file. I am also thankful to the
Principal and the school management of my
school for providing the necessary facilities
and a conducive environment for carrying
out this work. I would further like to extend
my thanks to my parents and friends for
their constant motivation, which helped me
accomplish this task successfully.
3|Page
Index
Write a programme to calculate any power of any number
Write a program to calculate the factorial of a number
Write a function to check if a number is prime or not
Write a programme to calculate the size of a file
File Handling
Exception Handling
WAP to calculate Area of different shapes(Using Function)
To compare n number of elements to know which is
greatest
CSV File handling
To calculate the roots of quadratic equation
To calculate sum of first n terms in Fibonacci series
Write a programme using show lines function
WAP on Book management(Using function)
SQL Queries
SQL Connectivity
4|Page
Practical file
Program 1: Write a programme to calculate any
power of any number
Output the programme is
5|Page
Write a program to calculate the factorial of
a number
Output of the code is
6|Page
Write a function to check if a number is
prime or not
Output of the code is
7|Page
Write a programme to calculate the size of a file
So, if the file is:
The output will be:
And if the file is
The output is
8|Page
Write a programme to create a simple
calculator
The output is
9|Page
Wap using Dump and load function
Output of the code is:
10 | P a g e
File handling
The output is:
11 | P a g e
Exception handling example
The output will be
12 | P a g e
Write a function to make an area calculator
13 | P a g e
The output will be
14 | P a g e
15 | P a g e
16 | P a g e
To compare n number of elements to know
which is greatest
Output
17 | P a g e
CSV file handling
Output
18 | P a g e
To calculate the roots of a quadratic function
Output:
1. Two equal roots
2. Two distinct roots
19 | P a g e
3. No real roots
20 | P a g e
To calculate sum of first n terms in Fibonacci serie
Output:
21 | P a g e
Write a program using show lines function
22 | P a g e
23 | P a g e
Write a programme on Book
management
24 | P a g e
25 | P a g e
Output of the code
26 | P a g e
27 | P a g e
28 | P a g e
SQL QUERIES
1. Create a student table with the student id, name, and marks as
attributes where the student id is the primary key.
2. Insert the details of a new student in the above table.
29 | P a g e
Output
3. Use the select command to get the details of the students
with marks more than 80.
30 | P a g e
4.Find the min, max, sum, and average of the marks in a
student marks table.
5.Write a SQL query to order the (student ID, marks)
table in descending order of the marks
31 | P a g e
SQL Connectivity code
32 | P a g e
Bibliography
Text books.
Computer Science with Python, NCERT
Class 12, 2024 Edition
Informatics Practices, NCERT Class 11 &
12
website and online resource.
Python Official Documentation
W3Schools Python Tutorial
SQLite Official Documentation
Reference books.
“Programming in Python”by Reema
Thareja, 2022 Edition
“Computer Science with Python for Class
12”by Sumita Arora
33 | P a g e