WGU D335 INTRO TO PYTHON | OA | OBJECTIVE ASSESSMENT ACTUALQUESTIONS AND CORRECT ANSWERS (VERIFIED
ANSWERS) PLUS RATIONALES 2026 Q&A |STUDY GUIDE| INSTANT DOWNLOAD PDF
Core Domains
Python syntax and basic structure
Data types and variables
Control structures (if/else, loops)
Functions and modular programming
Lists, tuples, and sequences
String manipulation
File I/O operations
Error handling and exceptions
Object-oriented programming basics
Python standard library modules*
The WGU D335 Intro to Python Objective Assessment evaluates foundational programming competency in Python, the world's most widely used
programming language. This exam assesses your ability to write, read, and debug Python code across core programming concepts including syntax,
data structures, control flow, functions, and basic object-oriented programming. The assessment consists entirely of multiple-choice and scenario-
based questions that require you to analyze code snippets, predict outputs, identify errors, and select optimal solutions. Real-world programming
scenarios emphasize practical application over theoretical memorization, testing your decision-making skills in contexts like data processing, file
manipulation, error handling, and algorithm development. Success demonstrates readiness for intermediate Python coursework and professional
programming tasks.*
Section One: Questions 1–100
Question 1
What is the correct output of the following code?
, python
print(2 ** 3 + 4)
A. 10
B. 11
C. 12
D. 8
🟢 Correct answer: B
🔴 RATIONALE: The exponent operator () has higher precedence than addition. 2 3 = 8, then 8 + 4 = 12. Wait, let me recalculate: 2 ** 3 = 8,
and 8 + 4 = 12. Actually the correct answer should be 12, which is option C. Let me fix this.
Question 1 (corrected)
What is the correct output of the following code?
python
print(2 ** 3 + 4)
A. 10
B. 11
C. 12
D. 8
🟢 Correct answer: C
🔴 RATIONALE: The exponent operator () has higher precedence than addition. 2 3 equals 8, then 8 + 4 equals 12.
Question 2
Which of the following is a valid variable name in Python?
,A. 2variable
B. my-variable
C. my_variable
D. my variable
🟢 Correct answer: C
🔴 RATIONALE: Variable names in Python cannot start with numbers, cannot contain spaces, and cannot contain hyphens. Only underscores are
allowed as special characters, making my_variable the only valid option.
Question 3
What data type is returned by the function type(5.0)?
A. int
B. float
C. str
D. bool
🟢 Correct answer: B
🔴 RATIONALE: The value 5.0 contains a decimal point, making it a float (floating-point number) in Python, not an integer.
Question 4
Which loop structure is guaranteed to execute at least once?
A. for loop
B. while loop
C. do-while loop
D. None of the above
🟢 Correct answer: D
🔴 RATIONALE: Python does not have a do-while loop. Both for and while loops may not execute if their conditions are not met initially (empty
sequence for for, false condition for while).
, Question 5
What is the output of the following code?
python
x = [1, 2, 3]
y = x
y.append(4)
print(x)
A.
B.
C.
D. Error
🟢 Correct answer: B
🔴 RATIONALE: In Python, y = x creates a reference to the same list object, not a copy. When y.append(4) modifies the list, x also reflects the
change since both reference the same object.
Question 6
Which method is used to add an element to the end of a list?
A. append()
B. add()
C. insert()
D. push()
🟢 Correct answer: A
🔴 RATIONALE: append() is the Python list method specifically designed to add an element to the end of a list. insert() requires specifying an index,
and add() and push() are not list methods.
ANSWERS) PLUS RATIONALES 2026 Q&A |STUDY GUIDE| INSTANT DOWNLOAD PDF
Core Domains
Python syntax and basic structure
Data types and variables
Control structures (if/else, loops)
Functions and modular programming
Lists, tuples, and sequences
String manipulation
File I/O operations
Error handling and exceptions
Object-oriented programming basics
Python standard library modules*
The WGU D335 Intro to Python Objective Assessment evaluates foundational programming competency in Python, the world's most widely used
programming language. This exam assesses your ability to write, read, and debug Python code across core programming concepts including syntax,
data structures, control flow, functions, and basic object-oriented programming. The assessment consists entirely of multiple-choice and scenario-
based questions that require you to analyze code snippets, predict outputs, identify errors, and select optimal solutions. Real-world programming
scenarios emphasize practical application over theoretical memorization, testing your decision-making skills in contexts like data processing, file
manipulation, error handling, and algorithm development. Success demonstrates readiness for intermediate Python coursework and professional
programming tasks.*
Section One: Questions 1–100
Question 1
What is the correct output of the following code?
, python
print(2 ** 3 + 4)
A. 10
B. 11
C. 12
D. 8
🟢 Correct answer: B
🔴 RATIONALE: The exponent operator () has higher precedence than addition. 2 3 = 8, then 8 + 4 = 12. Wait, let me recalculate: 2 ** 3 = 8,
and 8 + 4 = 12. Actually the correct answer should be 12, which is option C. Let me fix this.
Question 1 (corrected)
What is the correct output of the following code?
python
print(2 ** 3 + 4)
A. 10
B. 11
C. 12
D. 8
🟢 Correct answer: C
🔴 RATIONALE: The exponent operator () has higher precedence than addition. 2 3 equals 8, then 8 + 4 equals 12.
Question 2
Which of the following is a valid variable name in Python?
,A. 2variable
B. my-variable
C. my_variable
D. my variable
🟢 Correct answer: C
🔴 RATIONALE: Variable names in Python cannot start with numbers, cannot contain spaces, and cannot contain hyphens. Only underscores are
allowed as special characters, making my_variable the only valid option.
Question 3
What data type is returned by the function type(5.0)?
A. int
B. float
C. str
D. bool
🟢 Correct answer: B
🔴 RATIONALE: The value 5.0 contains a decimal point, making it a float (floating-point number) in Python, not an integer.
Question 4
Which loop structure is guaranteed to execute at least once?
A. for loop
B. while loop
C. do-while loop
D. None of the above
🟢 Correct answer: D
🔴 RATIONALE: Python does not have a do-while loop. Both for and while loops may not execute if their conditions are not met initially (empty
sequence for for, false condition for while).
, Question 5
What is the output of the following code?
python
x = [1, 2, 3]
y = x
y.append(4)
print(x)
A.
B.
C.
D. Error
🟢 Correct answer: B
🔴 RATIONALE: In Python, y = x creates a reference to the same list object, not a copy. When y.append(4) modifies the list, x also reflects the
change since both reference the same object.
Question 6
Which method is used to add an element to the end of a list?
A. append()
B. add()
C. insert()
D. push()
🟢 Correct answer: A
🔴 RATIONALE: append() is the Python list method specifically designed to add an element to the end of a list. insert() requires specifying an index,
and add() and push() are not list methods.