, WGU D335 Intro to Python Objective Assessment (NKO2) Study Guide | OA
Questions and Answers | 2026 Updated | 100% Correct.
Format: Multiple Choice + Code Analysis + Output Questions
Total Questions: 30 (High-quality, exam-aligned)
✅ QUESTION 1
What is the output of the following code?
x = 5
y = 2
print(x // y)
A. 2.5
B. 2
C. 3
D. 2.0
✅ Answer: B
💡 Rationale:
// is floor division, meaning it returns the integer part → 5 // 2 = 2.
✅ QUESTION 2
Which data type is mutable?
A. Tuple
B. String
C. List
D. Integer
✅ Answer: C
💡 Rationale:
Lists can be changed after creation; tuples and strings cannot.
,✅ QUESTION 3
What is the output?
print(type(3.14))
A. <class 'int'>
B. <class 'float'>
C. <class 'double'>
D. <class 'number'>
✅ Answer: B
💡 Rationale:
Decimal numbers in Python are floats.
✅ QUESTION 4
What will this code print?
nums = [10, 20, 30]
print(nums[-1])
A. 10
B. 20
C. 30
D. Error
✅ Answer: C
💡 Rationale:
Negative indexing starts from the end → -1 is last element.
✅ QUESTION 5
Which keyword is used for exception handling?
A. catch
B. error
, C. try
D. except
✅ Answer: C
💡 Rationale:
Exception handling begins with try block.
✅ QUESTION 6
What is the output?
for i in range(3):
print(i)
A. 1 2 3
B. 0 1 2
C. 0 1 2 3
D. Error
✅ Answer: B
💡 Rationale:
range(3) → 0,1,2 (stops before 3).
✅ QUESTION 7
What does .append() do?
A. Removes element
B. Adds element to end
C. Sorts list
D. Inserts at beginning
✅ Answer: B
💡 Rationale:
.append() adds to the end of a list.
Questions and Answers | 2026 Updated | 100% Correct.
Format: Multiple Choice + Code Analysis + Output Questions
Total Questions: 30 (High-quality, exam-aligned)
✅ QUESTION 1
What is the output of the following code?
x = 5
y = 2
print(x // y)
A. 2.5
B. 2
C. 3
D. 2.0
✅ Answer: B
💡 Rationale:
// is floor division, meaning it returns the integer part → 5 // 2 = 2.
✅ QUESTION 2
Which data type is mutable?
A. Tuple
B. String
C. List
D. Integer
✅ Answer: C
💡 Rationale:
Lists can be changed after creation; tuples and strings cannot.
,✅ QUESTION 3
What is the output?
print(type(3.14))
A. <class 'int'>
B. <class 'float'>
C. <class 'double'>
D. <class 'number'>
✅ Answer: B
💡 Rationale:
Decimal numbers in Python are floats.
✅ QUESTION 4
What will this code print?
nums = [10, 20, 30]
print(nums[-1])
A. 10
B. 20
C. 30
D. Error
✅ Answer: C
💡 Rationale:
Negative indexing starts from the end → -1 is last element.
✅ QUESTION 5
Which keyword is used for exception handling?
A. catch
B. error
, C. try
D. except
✅ Answer: C
💡 Rationale:
Exception handling begins with try block.
✅ QUESTION 6
What is the output?
for i in range(3):
print(i)
A. 1 2 3
B. 0 1 2
C. 0 1 2 3
D. Error
✅ Answer: B
💡 Rationale:
range(3) → 0,1,2 (stops before 3).
✅ QUESTION 7
What does .append() do?
A. Removes element
B. Adds element to end
C. Sorts list
D. Inserts at beginning
✅ Answer: B
💡 Rationale:
.append() adds to the end of a list.