PM SHRI KENDRIYA
VIDYALAYA NO.2
PORTBLAIR
COMPUTER SCIENCE PRACTICAL RECORD
SESSION : 2024-25
BY
NAME: ADITYA DUBEY
CLASS: XII B
ROLL NO: 12225
Page 1 of 26
CERTIFICATE
This is to certify that this practical record is a bonafide work done
by _________________________ of class
__________________Session 2024-25 of PM Shri Kendriya Vidyalaya
No.2, Port Blair in partial fulfillment of CBSE’s AISSCE Examination
………………………………………… …………………………………………..
Signature of External Examiner Signature of Internal Examiner
Name: ……………………………….. Name: M.UMASELVI
………………………………..
Signature of Principal
Name: Mr. Vishal Yadav
Place: PortBlair
Date:……………..
Page 2 of 26
OUTPUTS
PYTHON PROGRAM
1.To check the given number is prime or not.
2.To generate random variable and check if
the user won a lottery.
3.A menu driven program to perform
following in dictionary (roll no, name) add,
update, display, display all.
Page 3 of 26
4.To calculate the factorial of an integer.
5.To find sum of all elements of a list
passed as parameter.
6. To print Fibonacci series using function.
7.To find and return GCD and LCM of tow
numbers.
Page 4 of 26
8.To test if the string passed is a
palindrome or not.
9.To double the odd values and half the
even values in a list.
Page 5 of 26
10.Menu driven program that takes a tuple
as a parameter and return max, min and
sum of the elements.
11.To read a text file and display its
contents.
Page 6 of 26
12.To read a text file and display the number of
vowels/consonants/uppercase/lowercase/characters/digits
present in the file.
13.To count the number of “is” word on a
text file
Page 7 of 26
14.To count the number of lines starting
with ‘A’.
15.To read a text file line by line and display
each word separated by “#”.
16.To write those lines which have the
character ‘p’ from one text file to another
text file
Page 8 of 26
BINARY FILE
17.To create a binary file and write a
menu driven program to do the
following:
Insert record
Search record (get roll no)
Update record
Display all
Exit
Page 10 of 26
Page 12 of 26
18.To read all the content of and
display records of only those students
who scored more than 80 marks.
Page 13 of 26
19.To create a CSV file and write a
menu driven Program to do the
following:
Add a record
Search a record (get emp no)
Display all
Exit
Page 14 of 26
20.To show the detail of the student
who scored the highest marks. Data
stored in “student.csv” is given
below:
Roll no, Name, Marks.
1, Aman,35 2, Kanak,1 3, Anuj,33 4,
Suman,25
Page 15 of 26
1. CONNECTIVITY PYTHON
Practical 1
Aim to connect to MySQL server
• To create a database Student
• To create a table Student
• To add 6 rows
• To fetch and display the records
OUTPUT:
Page 16 of 26
Practical 2
Aim
• To Connect to database student
• To create a table result
• To add six rows
• To increase marks in Math by 5 for Sudha
• To fetch and display the records
Output:
Page 17 of 26
• equal to 90
• To fetch and display the records
OUTPUT:
Practical 4
Aim
• To connect to database student
• To create a Table staff
• To add 6 rows
• To fetch and display the records of all
Page 16 of 26
OUTPUT:
MYSQL
1. Create database name ‘kv2’.
2. Open the database ‘kv2’.
3. Create the following table: Student
Page 17 of 26
4. Add the following rows in the table student.
4. Add the following rows in
the table student.
5.Display all the tables
5. Display the details of all students.
Page 18 of 26
6. . Give the structure of the table student
7. Display the name and marks of all student
Page 19 of 26
8. Display the details of all students whose name contains second
letter as ‘a’.
Page 20 of 26
9. Display the details of all students in descending order of their
names.
10. Display the name of those students whose city is not
found.
11. Display the name and city of those students who
belongs to Chennai or Delhi.
Page 21 of 26
12. Display the name of those students whose age is 17
and belongs to Delhi.
13. Display the details of all students whose marks is in the
range of 400 to 450.
14. Display the details of all students whose marks is not in
the range of 400 to 450.
Page 22 of 26
15. Display the name of those students who belongs to
Delhi, Chennai or Kolkata.
16. Display the details of all students whose name contains
second last letter as ‘a’.
17. Display the names of all students whose name contains
5 letters.
18. Display the names of all students whose name contains
last letter as ‘a’.
Page 23 of 26
19. Display the names of different cities.
Page 24 of 26
20. Display the details of all students in ascending order of
city and then in descending order of names.
21. Change the mark of Ramya as 390.
22. . Give extra 10 marks to all students
23. Remove the details of those students who resides in
‘Chennai’.
24. Add a column named email id of type varchar and size
50.
Page 25 of 26
25. Increase the size of city column as 20.
26. Remove the column email id.
27. Remove the table student.
28. Remove the database kv2.
Page 26 of 26