P.E Practical
P.E Practical
Std-XII
REVIEW OF PYTHON
Q1: What error occurs when you execute the following Python code snippet? apple = mango
Q2: Which of the following can be used as valid variable identifier(s) in Python?
Q3: Which of the following forces an expression to be converted into specific type?
Q3: Which of the following forces an expression to be converted into specific type?
a)4 b)3 c) 8 d) 6
Q5: Which point can be considered as difference between string and list?
a) Length b) Mutability
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
Q3: Identify the module to which the following function load () belong to?
Q1: To read the entire remaining contents of the file as a string from a file object
myfile, we use
Q2: Which function of a file object can be used to fetch the current cursor position in
Q3: For the following python code, what will be the datatype of variables x, y, z given
f = open(‘story.txt’)
x = f.read(1)
y = f.readline()
z = f.readlines()
a. string, list, list b. None, list, list
Q4: If a text file is opened in w+ mode, then what is the initial position of file
pointer/cursor?
Q5: What will be the most correct option for possible output of the following code,
f = open(‘cricket.txt’)
data = f.read(150)
print(len(data))
BINARY FILES
Q1: Which is the valid syntax to write an object onto a binary file opened in the write
mode?
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?
a) total
b) Salute
c) Que$tion
d) global
Ans: a
Q3: Which of the following forces an expression to be converted into specific type?
Ans: D
a)4
b)3
c) 8
d) 6
Ans: A
Q5: Which point can be considered as difference between string and list?
Length
Mutability
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
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
a) Start_game()
b) start game()
c) start-game()
Ans: a
b) local
c) external
Ans: b
Q1: To read the entire remaining contents of the file as a string from a file object
myfile, we use
a. myfile.read(2)
b. myfile.read()
c. myfile.readline()
d. myfile.readlines()
Ans: b
Q2: Which function of a file object can be used to fetch the current cursor position in
a. seek( )
b. bytes( )
c. tell( )
d. fetch( )
Ans: c
Q3: For the following python code, what will be the datatype of variables x, y, z given
f = open(‘story.txt’)
x = f.read(1)
Advertisement
y = f.readline()
z = f.readlines()
Q4: If a text file is opened in w+ mode, then what is the initial position of file
pointer/cursor?
a. Beginning of file
b. End of the file
d. Undetermined
Q5: What will be the most correct option for possible output of the following code,
f = open(‘cricket.txt’)
data = f.read(150)
print(len(data))
BINARY FILES
Q1: Which is the valid syntax to write an object onto a binary file opened in the write
mode?
t = (10,20,30,40,50) #statement 2
myfile.close()
a. Statement 1 b. Statement 2
c. Statement 3 d. Statement 4
Q4: The opening function of a csv file is similar to the opening of:
Q5: Which mode opens the file for exclusive creation, which fails in the case where file
already exists
a. a b. w c. x d. r
DATA STRUCTURE
Q1: Which list method can be used to perform Pop operation in a stack implemented
by list?
Q2: Consider the following operation performed on a stack of size 3, What will be the
Puah(10)
Push(20)
Push(30)
Pop()
Push(40)
Push(50)
articles
CBSE Class 12
CBSE Class 12 Computer Science, 2024 Unit-Wise Important MCQs, Download PDF Here
CBSE Class 12 Computer Science Exam 2024: Download CBSE Class 12 Computer Science Important
MCQs in pdf format. This article will provide essential multiple-choice questions for CBSE Class 12 CS
examination 2024 with answers. Read the complete article for quick revision.
Atul Rawal
By Atul Rawal
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. 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 2024.
Practice Maths
Related Stories
CBSE Class 12 Political Science Sample Paper and Marking Scheme 2024-25: Download Free PDF
50+ Antonyms List for Kids and All Grades School Students
80+ Synonyms List for Kids And All Grades School Students
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?
a) total
b) Salute
c) Que$tion
d) global
Ans: a
Q3: Which of the following forces an expression to be converted into specific type?
Ans: D
a)4
b)3
c) 8
d) 6
Ans: A
Q5: Which point can be considered as difference between string and list?
Length
Mutability
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
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
a) Start_game()
b) start game()
c) start-game()
d) All of the above
Ans: a
a) global
b) local
c) external
Ans: b
Q1: To read the entire remaining contents of the file as a string from a file object
myfile, we use
a. myfile.read(2)
b. myfile.read()
c. myfile.readline()
d. myfile.readlines()
Ans: b
Q2: Which function of a file object can be used to fetch the current cursor position in
a. seek( )
b. bytes( )
c. tell( )
d. fetch( )
Ans: c
Q3: For the following python code, what will be the datatype of variables x, y, z given
f = open(‘story.txt’)
x = f.read(1)
y = f.readline()
z = f.readlines()
Ans: c
Q4: If a text file is opened in w+ mode, then what is the initial position of file
pointer/cursor?
a. Beginning of file
d. Undetermined
Ans: a
Q5: What will be the most correct option for possible output of the following code,
f = open(‘cricket.txt’)
data = f.read(150)
print(len(data))
b. 151
Ans: d
BINARY FILES
Q1: Which is the valid syntax to write an object onto a binary file opened in the write
mode?
Ans:a
Advertisement
t = (10,20,30,40,50) #statement 2
myfile.close()
Which of the following statement contains an error?
a. Statement 1
Advertisement
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?
Advertisement
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
Advertisement
(b) wb
(c) r+
(d) w+
Ans: b
CSV FILE
a. Semi colon
b. Colon
c. Comma
d. Hyphen
Ans: c
Advertisement
a. Open()
b. csv.open()
c. writer()
d. csv.writer()
Ans:b
a. reader()
b. read()
c. writer()
d. writerows()
Ans:b
Q4: The opening function of a csv file is similar to the opening of:
a. Binary file
b. Text File
c. Both of them
d. None of them
Ans: b
Read: 10 Best Engineering Institutes in India other than IITs, NITs and IIITs
Q5: Which mode opens the file for exclusive creation, which fails in the case where file
already exists
a. a
b. w
c. x
d. 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
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*
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*
Q4: Which list method can be used to perform Push operation in a stack implemented
by list?