Practice Paper (Term - I) Class - Xii Subject - Computer Science (083)
Practice Paper (Term - I) Class - Xii Subject - Computer Science (083)
CLASS - XII
SUBJECT - COMPUTER SCIENCE ( 083 )
TIME: 45 Min MM :25
1.Which of the following will delete key-value pair for key=’red’ form a dictionary D1 [1]
i. Delete D1(“red”) ii. del. D1(“red”)
iii. del D1[“red”] iv. del D1
a) 20#25#25# b) 30#40#70#
c) 15#60#70# d) 35#40#60#
7. Which type of error will occur when the following code is executed? [1]
>>>print(‘Cloud’ + 9)
(a) Syntax Error
(b) Type Error
(c) Name Error
(d) Value Error
a) tSduTyirggre0212 b) SduTyirggre1202
c) Error d) None of above
10. A variable declared outside all the functions in a python program, then mention the
statements which are True in the context of the variable. [1]
A. This variable will have global scope.
B. This variable will not be accessible from anywhere in the prog.
C. This variable will have a large lifetime than local variable.
D. This variable will be referred as Local variable.
i. Only 1&2 ii. Only 1 iii. Only 1&3 iv. Only 3
14. Which of the following file types can be opened with notepad as well as ms excel? [1]
a. Text Files
b. Binary Files
c. CSV Files
d. None of these
f = open("friends.txt")
l = f.readline()
l2 = f.readline(7)
l=f.readline()
ch3=f.read()
print(l2+l[20:30])
print(len(ch3.split()))
f.close()
10
11
19. Which of the following statement is False regarding the opening modes of a
file? [1]
(a) When you open a file for reading, if the file does not exist, an
error occurs.
(b) When you open a file for reading, if the file does not exist, the
program will open an empty file.
(c) When you open a file for writing, if the file does not exist, a new
file is created.
(d) When you open a file for writing, if the file exists, the existing
file is overwritten with the new file
(ii) In which mode, Shubham should open the file to add data into the file.(Line 2) [1]
(a) w+
(b) r
(c) r+
(d) a
(iii) Fill in the blank in Line 3 to read the data from a csv file. [1]
(a) load()
(b) read()
(c) reader()
(d) readline()
(v) Write the output he will obtain while executing Line 5. [1]