Self Studies

CBSE Class 12 Computer Science 2023 : Unit-Wise Important MCQs with Answers

CBSE Class 12 Computer Science 2023 : Unit-Wise Important MCQs with Answers

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. 

Important MCQs with Answers

Unit I: Computational Thinking and Programming-2

Review Of Python

Q1: What error occurs when you execute the following Python code snippet? apple = mango

  1. a) SyntaxError
  2. b) NameError
  3. c) ValueError
  4. d) TypeError

Ans: B

Q2: Which of the following can be used as valid variable identifier(s) in Python?

  1. total
  2. 7Salute
  3. Que$tion
  4. global

Ans: 7

Q3: Which of the following forces an expression to be converted into specific type?

  1. a) Implicit type casting 
  2. b) Mutable type casting
  3. c) Immutable type casting
  4. 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?

  1. Length
  2. Mutability 
  3. Indexing and Slicing
  4. 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 ______________________________

  1. a) main, keyword 
  2. b) caller, called
  3. c) called, caller 
  4. d) executer, execute

Ans: b

Q2: pow( ) function belongs to which library?

  1. a) math 
  2. b) string 
  3. c) random 
  4. d) maths

Ans: a

Q3: Identify the module to which the following function load () belong to?

  1. a) math 
  2. b) random 
  3. c) pickle 
  4. d) sys

Ans: c

Q4: Which of the following is a valid function name?

  1. a) Start_game() 
  2. b) start game() 
  3. c) start-game() 
  4. d) All of the above

Ans: a

Q5: The variable declared inside the function is called a variable

  1. a) global 
  2. b) local 
  3. c) external 
  4. d) none of the above

Ans: b

Data File Handline

Q1: To read the entire remaining contents of the file as a string from a file object myfile, we use

  1. myfile.read(2)
  2. myfile.read()
  3. myfile.readline()
  4. 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?

  1. seek( )
  2. bytes( )
  3. tell( )
  4. 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()

  1. string, list, list
  2. None, list, list
  3. string, string, list
  4. 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?

  1. Beginning of file
  2. End of the file
  3. Beginning of the last line of text file
  4. 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))

  1. It will always be 150
  2. 151
  3. More than or equal to 150
  4. 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?

  1. pickle.dump(<object to be written>, <file handle of open file>)
  2. pickle.dump(<file handle of open file>, <object to be written>)
  3. dump.pickle(<object>, <file handle>)
  4. 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?

a. Statement 1

b. Statement 2

c. Statement 3

d. 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 :

  1. Semi colon
  2. Colon
  3. Comma
  4. Hyphen

Ans:c

Q2: Which function is used to open a csv file ?

  1. Open()
  2. csv.open()
  3. writer()
  4. csv.writer()

Ans:b

Q3: Which among the following is not a function of csv module?

  1. reader()
  2. read()
  3. writer()
  4. writerows()

Ans:b

Q4: The opening function of a csv file is similar to the opening of:

  1. Binary file
  2. Text File
  3. Both of them
  4. None of them

Ans:b

Q5: Which mode opens the file for exclusive creation, which fails in the case where file already exists

  1. a
  2. w
  3. x
  4. 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

CBSE Class 12 Study Materials

CBSE Class 12 Syllabus 2022-23 CBSE Class 12 Previous Year Papers
NCERT Books For Class 12 Books NCERT Class 12 Solutions
CBSE Class 12 Full Study Material CBSE Class 12 Sample Paper 2022-23
Self Studies Home Quiz Quiz Self Studies Short News Self Studies Web Story
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now