WGU E010 FOUNDATIONS OF
PROGRAMMING (PYTHON) – 2026/2027
COMPREHENSIVE ASSESSMENT
1. Which of the following describes the behavior of the Python floor division operator (//)
when applied to negative numbers, such as -7 // 2?
A. It results in -4, rounding towards negative infinity.
B. It results in -3, rounding towards zero.
C. It results in -3.5, maintaining the float value.
D. It raises a ValueError due to sign ambiguity.
Answer: A
Conceptual Explanation: In Python, the floor division operator // returns the largest
integer less than or equal to the result. For -3.5, the largest integer less than or equal to it is
-4.
2. What will be the output of the code: x = [1, 2]; y = x; y.append(3); print(x)?
A. [1, 2]
B. [1, 2, 3]
C. [1, 2, [3]]
,D. AttributeError
Answer: B
Conceptual Explanation: Lists are mutable objects. When y = x is assigned, both variables
point to the same memory location. Modifying y also modifies x.
3. In Python, which built-in function is used to obtain the memory address of an object?
A. id()
B. address()
C. loc()
D. ref()
Answer: A
Conceptual Explanation: The id() function returns a unique identifier for an object, which
in CPython corresponds to its memory address.
4. What occurs when a mutable object like a list is used as a default argument in a function
definition?
A. The list is re-initialized to empty every time the function is called.
B. Python raises a SyntaxError.
C. The list becomes immutable within the scope of that function.
D. The same list object is shared across all calls that do not provide an argument.
, Answer: D
Conceptual Explanation: Default arguments are evaluated only once at the time of
function definition, meaning a mutable default will persist and accumulate changes across
calls.
5. Which of the following statements about Python’s ‘is’ operator is correct?
A. It checks if two variables have the same value.
B. It converts both operands to strings before comparison.
C. It is a synonym for the == operator.
D. It checks if two variables point to the same object in memory.
Answer: D
Conceptual Explanation: The ‘is’ operator tests for object identity, whereas ‘==’ tests for
value equality.
6. What is the result of the expression: 2 ** 3 ** 2?
A. 64
B. 512
C. 32
D. 128
Answer: B
PROGRAMMING (PYTHON) – 2026/2027
COMPREHENSIVE ASSESSMENT
1. Which of the following describes the behavior of the Python floor division operator (//)
when applied to negative numbers, such as -7 // 2?
A. It results in -4, rounding towards negative infinity.
B. It results in -3, rounding towards zero.
C. It results in -3.5, maintaining the float value.
D. It raises a ValueError due to sign ambiguity.
Answer: A
Conceptual Explanation: In Python, the floor division operator // returns the largest
integer less than or equal to the result. For -3.5, the largest integer less than or equal to it is
-4.
2. What will be the output of the code: x = [1, 2]; y = x; y.append(3); print(x)?
A. [1, 2]
B. [1, 2, 3]
C. [1, 2, [3]]
,D. AttributeError
Answer: B
Conceptual Explanation: Lists are mutable objects. When y = x is assigned, both variables
point to the same memory location. Modifying y also modifies x.
3. In Python, which built-in function is used to obtain the memory address of an object?
A. id()
B. address()
C. loc()
D. ref()
Answer: A
Conceptual Explanation: The id() function returns a unique identifier for an object, which
in CPython corresponds to its memory address.
4. What occurs when a mutable object like a list is used as a default argument in a function
definition?
A. The list is re-initialized to empty every time the function is called.
B. Python raises a SyntaxError.
C. The list becomes immutable within the scope of that function.
D. The same list object is shared across all calls that do not provide an argument.
, Answer: D
Conceptual Explanation: Default arguments are evaluated only once at the time of
function definition, meaning a mutable default will persist and accumulate changes across
calls.
5. Which of the following statements about Python’s ‘is’ operator is correct?
A. It checks if two variables have the same value.
B. It converts both operands to strings before comparison.
C. It is a synonym for the == operator.
D. It checks if two variables point to the same object in memory.
Answer: D
Conceptual Explanation: The ‘is’ operator tests for object identity, whereas ‘==’ tests for
value equality.
6. What is the result of the expression: 2 ** 3 ** 2?
A. 64
B. 512
C. 32
D. 128
Answer: B