PRACTICE • LEARN • GROW
Module 2: Data Types & Variables - Final Quiz MCQs
Solve topic-wise placement questions and improve your skills.
Module 2: Data Types & Variables - Final Quiz Progress
0 of 12 completed
0%
Topic Track
You are viewing MCQs in preview mode. Log in to select options, submit answers, and track your progress.
Log In to Answer
1
What is the defining characteristic of Dynamic Typing in Python?
A.
Variables must declare their type with keywords like int or str
B.
Variable types are inferred automatically at runtime, and the same variable name can be reassigned to hold different data types
C.
Variables can never change their value once initialized
D.
All numbers are converted to floating-point values automatically
Explanation & Key
Correct Answer:
2
Which of the following built-in Python types is MUTABLE?
A.
int
B.
tuple
C.
str
D.
list
Explanation & Key
Correct Answer:
3
What will be printed by the following code demonstrating variable name bindings?
a = [1, 2, 3]
b = a
b.append(4)
print(a)
A.
[1, 2, 3]
B.
[1, 2, 3, 4]
C.
TypeError
D.
[4]
Explanation & Key
Correct Answer:
4
What will be the output of the following division operators?
print(7 / 2, 7 // 2)
A.
3.5 3.5
B.
3.5 3
C.
3 3
D.
3 3.5
Explanation & Key
Correct Answer:
5
What is the output of the exponentiation operator in this expression?
print(2 ** 3 ** 2)
A.
64
B.
512
C.
36
D.
12
Explanation & Key
Correct Answer:
6
What will be printed by the comparison operators in the following snippet?
x = [1, 2]
y = [1, 2]
print((x == y), (x is y))
A.
True True
B.
False False
C.
True False
D.
False True
Explanation & Key
Correct Answer:
7
Why does
a = 256; b = 256; a is b evaluate to True, but x = 257; y = 257; x is y may evaluate to False in CPython?
A.
Because numbers above 256 are converted to floats
B.
CPython pre-allocates an internal cache of small integer objects in the range -5 to 256 at startup, reusing the exact same object instances
C.
Because 256 is a power of 2
D.
Because numbers above 256 require 64 bits
Explanation & Key
Correct Answer:
8
What is the result of casting float 3.89 to an integer using int(3.89)?
A.
4 (rounded)
B.
3 (truncated)
C.
3.89
D.
TypeError
Explanation & Key
Correct Answer:
9
What will be printed by the floor division of negative numbers in Python?
print(-7 // 2)
A.
-3
B.
-3.5
C.
-4
D.
TypeError
Explanation & Key
Correct Answer:
10
What will be the output of string multiplication in Python?
print("Go" * 3)
A.
TypeError: cannot multiply string by int
B.
GoGoGo
C.
Go 3
D.
Go*3
Explanation & Key
Correct Answer:
11
Which of the following values evaluates to
True when passed into bool() in Python?
A.
0
B.
[]
C.
None
D.
[0]
Explanation & Key
Correct Answer:
12
Which function should you use to check whether an object is an instance of a specific class or any of its subclasses?
A.
type(obj)
B.
isinstance(obj, ClassName)
C.
obj.class()
D.
typeof(obj)
Explanation & Key
Correct Answer:
Question Palette
Answered
Current
Not Attempted
Wrong