Professional Documents
Culture Documents
Sample Paper 7: Computer Science
Sample Paper 7: Computer Science
Sample Paper 7: Computer Science
SAMPLE PAPER 7
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.
2. Consider a declaration s = ‘‘computer’’, which of the following represents the data type
of s?
(a) list (b) tuple (c) dictionary (d) string
3. Given a list L1 = [3, 4, 5, 6, 8, 7, 7, 1, 2], what will be the output of print (L1 [3 : 7 : 2])?
(a) [6, 8, 7, 7, 1] (b) [6, 8, 7, 7]
(c) [6, 7] (d) (6, 7)
4. Which of the following is a path that contains the entire path to the file?
SAMPLE PAPER 7
5. Which of the following option can be used to read the 5 bytes of text file ‘‘Para.txt’’?
(a) f = open(“Para.txt”) (b) f = open(“Para.txt”)
f.read( ) = 5 f.read(5)
(c) f = open (“Para.txt”) (d) f = open(“Para.txt”)
f.readline(5) f.readlines(5)
116 CBSE Sample Paper Computer Science Class XII (Term I)
6. Assume f is file object and to change the current position of file to 3 bytes forward.
Which statement will be used?
(a) f.seek(3, 1) (b) f.seek(1, 3)
(c) f.tell(3, 1) (d) f.tell(1, 3)
9. Which of the following loop is used for fixed number of iterations in Python?
(a) while loop (b) for loop
(c) do while loop (d) All of these
10. Consider the tuple t = (3, 4, 5, 8, 2). Identify the statement that will result in an error.
(a) print(t [1]) (b) t[3] = 9
(c) print(min(t)) (d) print(len(t))
11. Identify the category of the function that contains those functions which provide the
facility for doing some pre-defined operations.
(a) Built-in function (b) Library function
(c) Both (a) and (b) (d) None of these
14. Which type of the argument need to be included in the proper position?
(a) Default argument (b) Name argument
(c) Positional argument (d) Friendly argument
20. In order to store values in terms of keys what basic data type can be used?
(a) List (b) Tuple
(c) String (d) Dictionary
22. What happens, if a local variable exists with the same name as the global variable you
want to access?
(a) Error
(b) The local variable is shadowed
(c) Undefined behavior
(d) The global variable is shadowed
24. Which type of data file stores the data in tabular form?
SAMPLE PAPER 7
Section B
This section consists of 24 questions (26 to 49). Attempt any 20 questions.
(a) 4 (b) 9
(c) 12 (d) 23
32. Naman is trying to write a tuple tup1 = (5, 3, 4, 3) on a binary file ‘‘story.bin’’. Consider
the following code written by him.
import pickle
tup1 = (5, 3, 4, 3)
f = open(“story.bin”, ‘wb’)
pickle. _____ # Statement 1
f. close( )
Identify the missing code in Statement 1.
(a) dump (f,tup1) (b) dump (tup1, f)
(c) write (tup1,f) (d) load (f,tup1)
33. Evaluate the following expression and identify the correct answer.
10*4 // 2 + 4 − 2 //2 + 4 − 3 + 5 // 8
(a) 24 (b) 34 (c) 22 (d) 20
(a) 2 3 4 5 6 1 (b) 6 1 2 3 4 5
(c) 4 9 6 2 3 3 (d) 4 4 2 9 6 3
test()
print(a)
print(b)
(a) 12 (b) 13 (c) 12 (d) 36
33 12 36 21
35
44. What is the output of below code, when the list L contains [3, 5, 81, 7, 17]?
def test (L):
for i in range (len (L)) :
if(L [i]% 3 = = 0) :
L [i] = L [i] + 4
print(L)
(a) [3, 9, 81, 11, 21] (b) [5, 5, 31, 7, 17]
(c) [7, 5, 85, 7, 17] (d) [7, 9, 85, 11, 21]
(c) 2 # 5 # 9 # (d) 2 # 3 # 4 #
Section C
(Case Study Based Questions)
This section consists of 6 questions (50 to 55). Attempt any 5 questions.
Here is a program to check whether a passed string is palindrome or not.
def isPalindrome ( ) :
str1 = input(“Enter string”)
SAMPLE PAPER 7
54. Identify the statement for blank space in line marked as Statement 5.
(a) left_pos + = 1 (b) left_pos− =1
(c) right_pos− = 1 (d) right_pos+ =1
55. Identify the suitable value for blank space in line marked as Statement 6.
(a) False (b) True
(c) Flag (d) None
SAMPLE PAPER 7