Class 12 CS Model 1 QST
Class 12 CS Model 1 QST
Class 12 CS Model 1 QST
MODEL EXAMINATION - 1
COMPUTER SCIENCE
CLASS :12 B MARLK:70
TIME:3hrs
Q No. Section-A (21 x 1 = 21 Marks)
1 State True or False
"In Python, data type of a variable depends on its value"
2 What will be the output of the following python expression? print(2**3**2)
a. 64 b. 256 c. 512 d. 32
3 What will be the output of the following python dictionary operation?
data = {'A':2000, 'B':2500, 'C':3000, 'A':4000}
print(data)
a. {'A':2000, 'B':2500, 'C':3000, 'A':4000} b. {'A':2000, 'B':2500, 'C':3000}
c. {'A':4000, 'B':2500, 'C':3000} d. It will generate an error.
4 Select the correct output of the code:
a = "Year 2024 at all the best"
a = a.split('a')
b = a[0] + "-" + a[1] + "-" + a[3]
print (b)
a. Year – 0- at All the best b. Ye-r 2024 -ll the best
c. Year – 024- at All the best d. Year – 0- at all the best
5 Which of the following statement(s) would give an error during execution?
S=["CBSE"] # Statement 1
S+="Delhi" # Statement 2
S[0]= '@' # Statement 3
S=S+"Thank you" # Statement 4
a) Statement 1 b) Statement 2 c) Statement 3 d) Statement 4
6 Choose the ouptut
dic1={‘r’:’red’,’g’:’green’,’b’:’blue’}
for i in dic1:
print (i,end=’’)
a. rgb b. redgreenblue c. red’green’blue d.None
7 Select the correct output of the code:
for i in "QUITE":
print([i.lower()], end= "#")
Section-D ( 4 x 4 = 16 Marks)
32 (a) What does CSV stand for?
(b) Write a Program in Python that defines and calls the following user defined functions:
(i) InsertRow() – To accept and insert data of an student to a CSV file ‘class.csv’. Each
record consists of a list with field elements as rollno, name and marks to store roll
number, student’s name and marks respectively.
(ii) COUNTD() – To count and return the number of students who scored marks greater
than 75 in the CSV file named ‘class.csv’.
33 Sanjay is working on a binary file, PRODUCTS.DAT, containing records of the following
structure:{‘PID’:Product ID, ‘PNAME’:Product Name , ‘PRICE’:Product Price}
Help him to write the following user defined functions:
(i) appendData(), that reads the values of Product ID, Product Name and Product price
from the user into a dictionary and append it into binary file PRODUCTS.DAT.
(ii) findProduct(product_id) that accepts product_id as argument to read binary file
PRODUCTS.DAT and display the details of that product.
34 Write a program to create a Stack for storing only odd numbers out of all the numbers
entered by the user. Display the content of the Stack along with the largest odd number
in the Stack. (Hint. Keep popping out the elements from stack and maintain the largest
element retrieved so far in a variable. Repeat till Stack is empty)
35 Explain the following
a)tell() and seek() b)positional arguments and keyword arguments
SECTION E (2 X 5 = 10 Marks)
36 Oxford college, in Delhi is starting up the network between its different wings.
There are four Buildings named as SENIOR, JUNIOR, ADMIN and HOSTEL
as shown below: