Objective Assessment 2026/2027 –
Practice Questions, Answers & Detailed
Rationales Guranteed pass (GRADED A+)
Question 1
Which Python data type is mutable?
A. Tuple
B. String
C. List
D. Integer
Answer: _C. List_
Rationale: Lists are mutable, meaning their elements can be changed
after the list is created. Strings, tuples, and integers are immutable.
Question 2
Which Python statement is used to handle an exception?
A. if/else
B. try/except
C. for/while
D. def/return
Answer: _B. try/except_
,Rationale: The try block contains code that may generate an
exception, while except defines how the program should respond
when that exception occurs.
Question 3
Which module is commonly used to work with operating-system
functionality such as environment variables and directory operations?
A. os
B. math
C. random
D. statistics
Answer: _A. os_
Rationale: Python's os module provides an interface to operating-
system features, including paths, directories, environment variables, and
process-related operations.
Question 4
What does the following expression return?
len("Python")
A. 5
B. 6
C. 7
D. 8
Answer: _B. 6_
,Rationale: The string "Python" contains six characters: P, y, t, h, o,
and n.
Question 5
Which method adds one item to the end of a Python list?
A. insert()
B. extend()
C. append()
D. add()
Answer: _C. append()_
Rationale: append() adds a single element to the end of a list.
extend() adds elements from an iterable.
Question 6
Which file mode opens an existing file for reading?
A. w
B. a
C. r
D. x
Answer: _C. r_
Rationale: The r mode opens a file for reading. The w mode writes and
can overwrite existing content, while a appends.
, Question 7
What is the primary purpose of a Python function?
A. To permanently store data
B. To group reusable code
C. To automatically install packages
D. To replace variables
Answer: _B. To group reusable code_
Rationale: Functions organize instructions into reusable blocks that can
accept inputs and optionally return results.
Question 8
Which keyword is used to define a function in Python?
A. function
B. define
C. func
D. def
Answer: _D. def_
Rationale: Python uses the def keyword followed by the function name
and parameter list to define a function.
Question 9
Which Python library is commonly used to make HTTP requests?