You are on page 1of 3

SENIOR SCHOOL CERTIFICATE EXAMINATION 2023 -24

PRACTICAL EXAM QUESTION PAPER

Subject: Computer Science (083) Class: XII

Time: 3:00 Hours Set - 1 Max. Marks: 30

Q-1 a) Write a program to read a text file my_file.txt and display the
number of vowels/consonants/uppercase/lowercase characters in
the file. 8
Example:
File Contents as given below
Python is super and trending language.
Allows to store the output in the files.
A text file stores textual data.
Program output must be as follows
Vowels: 35
Consonants: 58
Uppers: 3
Lowers: 87
b) Observe the following code and fill in the given blanks as directed: 4

import ___________ as mycon # Statement 1


mydb=mycon.connect(_________________) # Statement 2
mycursor=mydb._____________# Statement 3
mycursor.execute(________________________) Statement 4

The partial code is given for creating database “Customers”.


i. Write name of the module to fill statement 1 to be imported.
ii. Write the parameters and values required to fill statement 2.
The parameters values are as follows:

i. Write function name to create cursor and fill in the gap for
statement 3.
iv. Write a query to fill statement 4 to create database Customers.

Q- 2 Practical Report File 7


Q- 3 Project 8
Q- 4 Viva Voce 3
SENIOR SCHOOL CERTIFICATE EXAMINATION 2023 -24
PRACTICAL EXAM QUESTION PAPER

Subject: Computer Science (083) Class: XII

Time: 3:00 Hours Set - 2 Max. Marks: 30

Q-1 a) Write a program to count a total number of lines and count


the total number of lines starting with 'A', 'B', and 'C' from the file
myfile.txt. 8

Example:
File Contents as given below
Python is super and trending language.
Allows to store the output in the files.
A text file stores textual data.
Binary files can handle binary data.
Binary files use pickle module to store data.
CSV files can handle tabular data.
CSV files can be read easily using CSV reader object.

Program output must be as follows:


Total Number of lines are: 7
Total Number of lines starting with A are: 2
Total Number of lines starting with B are: 2
Total Number of lines starting with C are: 2

b) Observe the following code and fill in the given blanks as directed: 4

import ___________ as mycon # Statement 1


mydb=mycon.connect(_________________) # Statement 2
mycursor=mydb._____________# Statement 3
mycursor.execute(________________________) Statement 4
The partial code is given for creating database “Customers”.

i. Write name of the module to fill statement 1 to be imported.


ii. Write the parameters and values required to fill statement 2.
The parameters values are as follows:

ii. Write function name to create cursor and fill in the gap for
statement 3.
iii. Write a query to fill statement 4 to create database Customers.

Q- 2 Practical Report File 7


Q- 3 Project 8
Q- 4 Viva Voce 3

You might also like