You are on page 1of 3

Class : XII

Session 2021-22
Computer Science Practical List
Term I
Report File

1. Write a program in Python to count the number of words and spaces present in a text file
“Article.txt” .
2. A file sports.txt contains information in following format :
Event – Participant
Write a function in Python that would read contents from file sports.txt and creates a file named
Athletics.txt copying only those records from sports.txt where the event name is “Athletics.
3. Write a function DisplayWords() in Python to read lines from a text file Story.txt and display
those words, which are less than 4 characters long.
4. Write a program that reads characters from the keyword one by one . All lower case characters get
stored inside the file LOWER, all upper case characters get stored inside the file UPPER and all
other characters get stored inside file OTHERS.
5. Write a function in Python to count and display the number of lines starting with alphabets ‘A’
present in a text file “Lines.txt”
6. Write a program in Python to read a text file line by line and display each word separated by a #.
7. Write a program in Python to read a text a file and display the number of vowels, consonants,
uppercase and lowercase characters in the file.
8. Write a program in Python to 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.
9. Write a program in Python to create a Binary file with roll number, name and marks. Input a roll
number and update the marks.
10. Write a program in Python to remove all the lines that contain the character ‘a’ in a file and write
it to another file.
11. Write a program in Python to create a CSV file by entering user-id and password, read and
search the password for given user-id.
12. Write a program in Python to create a CSV file containing the fields roll number, student name,
class, section and percentage, read the file and display a record based on the roll number entered .
13. Write a program in Python to create a CSV file containing the fields roll number, student name,
class, section and percentage, read the file and copy those records having percentage less than 33
to another CSV file .
14. Write a program in Python to create a CSV file with roll number, name and percentage, read the
file and display the name of student having highest percentage .
15. Write a program in Python to take a sample of ten phishing e-mails (or any text file) and find
most commonly occurring words.

Project
Term-I

Synopsis of the project to be submitted by the students (documentation only, may not submit the code
during Term-1).
Term-II

1.Write a program in Python to implement Push operation on stack using a list data-structure.
2.Write a program in Python to implement Pop operation on stack using a list data-structure.
3.Write a program in Python to implement Peek operation on stack using a list data-structure..

Python Database Connectivity Script


Consider the following Student table of database test
Rollno Name Percent Grade Section Project
101 Ruhani 76.80 A A Pending
102 George 71.20 B A Submitted
103 Simran 81.20 A B Evaluated
104 Ali 61.20 B C Assigned
105 Kushal 51.60 C C Evaluated
106 Arsiya 91.60 A+ B Submitted
107 Raunak 32 F B Submitted

4. Write a Python database connectivity scripts that displays all the records having Percent greater
than 80 from Student table of database test.
5. Write a Python database connectivity scripts that displays Name, Percent and Project for students
who had ‘Submitted’ the project from Student table of database test.

SQL Queries

6. Write SQL commands for the on the basis of given table Student.

Table: Student
Rollno Name Stipend Stream Avgmarks Grade Class
1 Karan 400.00 Medical 78.5 B 12B
2 Divakar 450.00 Commerce 89.2 A 11C
3 Divya 300.00 Commerce 68.6 C 12C
4 Arun 350.00 Humanities 73.1 B 12C
5 Sabina 500.00 Nonmedical 90.6 A 11A
6 John 400.00 Medical 75.4 B 12B
7 Robert 250.00 Humanities 64.4 C 11A
8 Rubina 450.00 Nonmedical 88.5 A 12A
9 Vikas 500.00 Nonmedical 92.0 A 12A
10 Mohan 300.00 Commerce 67.5 C 12C

a) Display all the Nonmedical stream students from Student.


b) List the names of those students who are in class 12 sorted by stipend.
c) List all students sorted by AvgMark in descending order.
d) Display the average stipend Stream wise.
e) Increase the stipend for commerce student by Rs. 50/-
Project
Term-II

Final coding. Submit the final executable code both soft copy and hard copy(Project report).

You might also like