Programming with Python
Objective Assessment Review (Qns & Ans)
2025
Multiple Choice Questions
Which of the following is a feature of Python’s list
comprehension?
A) It can only process integers.
B) It allows for concise construction of lists.
C) It requires a loop syntax.
D) It cannot include conditional statements.
Correct ANS: B
©2025
,Rationale: List comprehension provides a concise way to create
lists using expressions and can include conditional statements.
Which Python data structure is mutable and allows for duplicate
elements?
A) Tuple
B) Set
C) List
D) Dictionary
Correct ANS: C
Rationale: Lists in Python are mutable, meaning they can be
changed after they are created, and they allow for duplicate
elements.
In Python, what is the output of the expression: len("Python")?
A) 5
B) 6
C) 7
D) "Python"
Correct ANS: B
©2025
,Rationale: The len() function returns the number of characters in a
string, which for "Python" is 6.
Which of the following keywords is used to define a function in
Python?
A) function
B) def
C) func
D) define
Correct ANS: B
Rationale: The keyword def is used to define a function in Python.
What will be the output of the following code snippet? print([1, 2,
3] + [4, 5, 6])
A) [1, 2, 3, [4, 5, 6]]
B) [1, 2, 3, 4, 5, 6]
C) Error
D) [4, 5, 6, 1, 2, 3]
Correct ANS: B
©2025
, Rationale: The + operator concatenates two lists together.
Fill-in-the-Blank Questions
In Python, a ________ is a way to create an iterable sequence of
numbers.
Correct ANS: range
Rationale: The range() function generates a sequence of numbers
and is commonly used in for-loops.
The function that converts a string from lowercase to uppercase in
Python is ________.
Correct ANS: upper()
Rationale: The .upper() method is used to convert all characters in
a string to uppercase.
Python uses ________ formatting to allow for dynamic output in
strings, commonly represented by f-strings.
Correct ANS: f-string
©2025