CBSE Class 12 Computer Science MCQs: Sitting in the examination without proper preparations is like hitting the target in the dark. It has a higher probability of missing the target. Why take a chance when you have the time? Let us help you to prepare better for your upcoming computer science exam. As per CBSE date sheet, the exam for CBSE Class 12 Computer Science is scheduled for tomorrow. Revise the objective type questions or MCQs. These will be the 1 mark questions and students can use them to increase their CBSE Class 12 Computer Science score. You will find these in the very initial section of the paper. Please read the below-mentioned unit-wise important MCQs that will help you in your CBSE Class 12 Computer Science Exam 2023.
Unit I: Computational Thinking and Programming-2
REVIEW OF PYTHON
Q1: What error occurs when you execute the following Python code snippet? apple = mango

- a) SyntaxError
- b) NameError
- c) ValueError
- d) TypeError
Ans: B
Q2: Which of the following can be used as valid variable identifier(s) in Python?
- total
- 7Salute
- Que$tion
- global
Ans: 7
Q3: Which of the following forces an expression to be converted into specific type?
- a) Implicit type casting
- b) Mutable type casting
- c) Immutable type casting
- d) Explicit type casting
Ans: D
Q4: If l=[11,22,33,44], then output of print(len(l)) will be
a)4
b)3
- c) 8
- d) 6
Ans: A
Q5: Which point can be considered as difference between string and list?
- Length
- Mutability
- Indexing and Slicing
- Accessing individual elements
Ans: B
Functions
Q1: In python function, the function calling another function is known as_____________and the function being called is known ______________________________
- a) main, keyword
- b) caller, called
- c) called, caller
- d) executer, execute
Ans: b
Q2: pow( ) function belongs to which library?
- a) math
- b) string
- c) random
- d) maths
Ans: a
Q3: Identify the module to which the following function load () belong to?
- a) math
- b) random
- c) pickle
- d) sys
Ans: c
Q4: Which of the following is a valid function name?
- a) Start_game()
- b) start game()
- c) start-game()
- d) All of the above
Ans: a
Q5: The variable declared inside the function is called a variable
- a) global
- b) local
- c) external
- d) none of the above
Ans: b
DATA FILE HANDLING
Q1: To read the entire remaining contents of the file as a string from a file object
myfile, we use
- myfile.read(2)
- myfile.read()
- myfile.readline()
- myfile.readlines()
Ans: b
Q2: Which function of a file object can be used to fetch the current cursor position in
terms of number of bytes from beginning of file?
- seek( )
- bytes( )
- tell( )
- fetch( )
Ans: c
Q3: For the following python code, what will be the datatype of variables x, y, z given
that the code runs without any error?
f = open(‘story.txt’)
x = f.read(1)
y = f.readline()
z = f.readlines()
- string, list, list
- None, list, list
- string, string, list
- string, string, string
Ans: c
Q4: If a text file is opened in w+ mode, then what is the initial position of file
pointer/cursor?
- Beginning of file
- End of the file
- Beginning of the last line of text file
- Undetermined
Ans: a
Q5: What will be the most correct option for possible output of the following code,
given that the code executes without any error.
f = open(‘cricket.txt’)
data = f.read(150)
print(len(data))
- It will always be 150
- 151
- More than or equal to 150
- Less than or equal to 150
Ans: d
BINARY FILES
Q1: Which is the valid syntax to write an object onto a binary file opened in the write
mode?
- pickle.dump(<object to be written>, <file handle of open file>)
- pickle.dump(<file handle of open file>, <object to be written>)
- dump.pickle(<object>, <file handle>)
- None of the above
Ans:a
Q2: Rahul is trying to write a tuple t = (10,20,30,40,50) on a binary file
notebook.bin. Consider the following code written by him.
import pickle #statement 1
t = (10,20,30,40,50) #statement 2
myfile = open("notebook.bin",'w') #statement 3
pickle.dump(t, myfile) #statement 4
myfile.close()
Which of the following statement contains an error?
- Statement 1
- Statement 2
- Statement 3
- Statement 4
Ans:c
Q3: 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 the above
Ans: b
Q4: Which of the following function is used to read data from a binary file?
(a) write
(b) load
(c) dump
(d) scan
Ans: b
Q5: Choose the file mode used to write data into binary file.
(a) rb
(b) wb
(c) r+
(d) w+
Ans: b
CSV FILE
Q1: The default delimiter for a CSV file is :
- Semi colon
- Colon
- Comma
- Hyphen
Ans:c
Q2: Which function is used to open a csv file ?
- Open()
- csv.open()
- writer()
- csv.writer()
Ans:b
Q3: Which among the following is not a function of csv module?
- reader()
- read()
- writer()
- writerows()
Ans:b
Q4: The opening function of a csv file is similar to the opening of:
- Binary file
- Text File
- Both of them
- None of them
Ans:b
Q5: Which mode opens the file for exclusive creation, which fails in the case where file
already exists
- a
- w
- x
- r
Ans:c
DATA STRUCTURE
Q1: Which list method can be used to perform Pop operation in a stack implemented
by list?
(a) pop()
(b) pop(1)
(c) remove()
(d) pop(0)
Ans:a
Q2: Consider the following operation performed on a stack of size 3, What will be the
output? (* top position)
Puah(10)
Push(20)
Push(30)
Pop()
Push(40)
Push(50)
(a) overflow
(b) underflow
(c) 10 20 30 40 50*
(d) 10 20 40 50*
Ans:a
Q3: Choose the correct output for the following stack operation(* top position)
Push(5)
Push(8)
Pop()
Push(2)
Push(5)
Pop()
Push(1)
(a) 8 5 2 5 1*
(b) 8 5 5 2 1*
(c) 2 5 5 1*
(d) 5 2 1*
Ans: d
Q4: Which list method can be used to perform Push operation in a stack implemented
by list?
(a) append()
(b) extend()
(c) push()
(d) insert()
Ans: a
To download the complete pdf of CBSE Class 12 Computer Science unit-wise important MCQs click on the link below:
CBSE Class 12 Computer Science Important MCQs (Unit-wise) 2023 |
Want further help with your CBSE Class 12 Computer Science 2022-23 Board Exam? Please read the articles present below: