Sample Paper 1: Computer Science
Sample Paper 1: Computer Science
Sample Paper 1: Computer Science
SAMPLE PAPER 1
COMPUTER SCIENCE
A Highly Simulated Practice Questions Paper
for CBSE Class XII (Term I) Examination
Instructions
1. This question paper is divided into three sections.
2. Section - A contains 25 questions (1-25). Attempt any 20 questions.
3. Section - B contains 24 questions (26-49). Attempt any 20 questions.
4. Section - C contains 6 case study based questions (50-55). Attempt any 5 questions.
5. Each question carries 0.77 mark.
6. There is no negative marking.
Maximum Marks : 35
Roll No. Time allowed : 90 min
Section A
This section consists of 25 questions (1 to 25). Attempt any 20 questions from this section. Choose the best
possible option.
8. You can repeat the elements of the tuple using which operator?
(a) * (b) + (c) ** (d) %
13. In which file, no delimiters are used for line and no translations occur?
(a) Text file (b) Binary file (c) CSV file (d) None of these
14. Which attribute is used to return access mode with that file was opened?
(a) mode.file (b) mode.file.name (c) file.mode (d) file.mode.type
18. Suppose list1 is [56, 89, 75, 65, 99], what is the output of list1 [− 2]?
(a) Error (b) 75 (c) 99 (d) 65
20. dl={“abc”:5,“def”:6,“ghi”:7}
SAMPLE PAPER 1
print(d1[0])
What will be the output of above Python code?
(a) abc (b) 5 (c) {“abc”:5} (d) Error
22. str1=“659.31”
print(“str1”)
What will be the output of above Python code?
(a) 1 (b) 6/4 (c) 1.5 (d) str1
Section B
This section consists of 24 questions (26 to 49). Attempt any 20 questions.
32. Observe the following code and answer the question that follow.
File = open(“Mydata”, “a”)
_______#Blank
File. close()
Fill in the blank with statement to write “ABC” in the file “Mydata”.
(a) File.write() (b) File.write(ABC) (c) write(ABC) (d) File.write(“ABC”)
35. Evaluate the following expression, when a = 10, b = 5 and identify the correct answer.
x = a*3//4+b//4+4−a+5//6
(a) 12 (b) 4 (c) 2 (d) 6
37. What possible output(s) are expected to be displayed on screen at the time of execution
of the program from the following code?
import random
ar = [2, 3, 4, 5, 6, 7]
minn = random.randint (1, 3)
maxn = random.randint (2, 4)
for i in range (minn, maxn + 1):
print (ar [i], end = ‘#’)
(a) 3# 4# 5# (b) 5# 6# 7# (c) 1# 4# 7# (d) 4# 5# 7#
for i in a:
print(i)
test((3,4,5,3,7))
(a) 3 (b) 3, 4, 5, 3, 7 (c) 3 4 5 3 7 (d) None of these
4
5
3
7
48 CBSE Sample Paper Computer Science Class XII (Term I)
file.close()
(a) 2 (b) 3 (c) 4 (d) 5
print (x)
print (x)
(a) 5 (b) 5 (c) 6 (d) 6
3 4 4 3
46. Observe the code given below and find the output, if the content of file ‘‘student.txt’’ is
S01, Rahul Verma, First division
S02, Reetesh Deshmukh, First division
S03, Aaditya Mishra, Second division
S04, Aradhaya Sinha, Third division
S05, Manish Sharma,Third division
Hello
Mode. png
Section C
(Case Study Based Questions)
This section consists of 6 questions (50 to 55). Attempt any 5 questions.
Shreya write a program to check if elements of a list are same or not, it read from front or
back.
a = [1, 2, 3, 3, 2, 1]
i = ______ #line 1
mid = (len (a))/2
same = True
while ______ #line 2
if a[i] ! = ______ : #line 3
print (“No”)
same = False
______ #line 4
______ #line 5
if same = = ______ : #line 6
print (“Yes”)
52. Choose the correct option to fill up the blank in line 3 as marked.
(a) a[len(a)] (b) a[len(a) − i] (c) a[len(a) − 1] (d) a[len(a)− i − 1]
53. Choose the correct option to fill up the blank in line 4 as marked.
(a) continue (b) label (c) goto (d) break
54. Choose the correct option to fill up the blank in line 5 as marked.
(a) i = i + 1 (b) i = i − 1 (c) i = i * i (d) i = i + mid
55. What value will be equal to ‘‘same’’ in if condition in line 6 as marked?
(a) False (b) True (c) 0 (d) 1