1
WGU D335 – INTRODUCTION TO PYTHON OA
PRACTICE EXAM 2026-27 LATEST VERSION
Exam Introduction
The WGU D335: Introduction to Python OA assesses a student’s ability to
understand, write, and debug Python programs. This includes fundamental
programming concepts, data types, control structures, functions, and basic
object-oriented programming.
This practice exam is designed for students preparing for the OA, helping them
practice multiple-choice and scenario-based coding questions.
Exam Structure
• Total Questions: 100 multiple-choice or multiple-answer questions
• Domains Covered:
1. Python Basics – syntax, variables, data types, and operators
2. Control Structures – conditionals and loops
3. Functions – defining, calling, and return values
4. Data Structures – lists, tuples, dictionaries, sets
5. Modules & Libraries – imports, common built-in functions
6. Basic Object-Oriented Concepts – classes, objects, methods,
attributes
7. File Handling & Exception Handling
• Format:
o Multiple-choice, single correct answer
o Each question includes rationale for learning reinforcement
,2
Practice Exam Questions 1–20
Python Basics
1. Which of the following is the correct way to declare a
variable in Python?
A. x = 10
B. int x = 10
C. var x = 10
D. x := 10
Answer: A
Rationale: Python uses dynamic typing; variables are assigned
using = without specifying type.
2. Which of the following is a valid Python data type?
A. list
B. array
C. vector
D. record
Answer: A
Rationale: list is a built-in mutable sequence type; Python does
not have native array or vector.
,3
3. What is the output of print(type(3.14))?
A. <class 'float'>
B. <class 'int'>
C. <class 'double'>
D. <class 'decimal'>
Answer: A
Rationale: 3.14 is a floating-point number, represented by float
in Python.
4. What symbol is used for exponentiation in Python?
A. **
B. ^
C. *
D. %
Answer: A
Rationale: ** is the exponentiation operator in Python (2**3 =
8).
5. Which of these is a valid string in Python?
A. "Hello, World!"
B. Hello, World!
C. 'Hello, World!
D. Hello, World!
, 4
Answer: A
Rationale: Strings must be enclosed in single or double quotes.
6. Which Python keyword is used to define a function?
A. def
B. function
C. func
D. define
Answer: A
Rationale: Functions are defined using the def keyword.
7. What is the result of len([1, 2, 3, 4])?
A. 4
B. 3
C. 5
D. 1
Answer: A
Rationale: len() returns the number of elements in a list.
8. Which operator is used for integer division in Python?
A. //
B. /
WGU D335 – INTRODUCTION TO PYTHON OA
PRACTICE EXAM 2026-27 LATEST VERSION
Exam Introduction
The WGU D335: Introduction to Python OA assesses a student’s ability to
understand, write, and debug Python programs. This includes fundamental
programming concepts, data types, control structures, functions, and basic
object-oriented programming.
This practice exam is designed for students preparing for the OA, helping them
practice multiple-choice and scenario-based coding questions.
Exam Structure
• Total Questions: 100 multiple-choice or multiple-answer questions
• Domains Covered:
1. Python Basics – syntax, variables, data types, and operators
2. Control Structures – conditionals and loops
3. Functions – defining, calling, and return values
4. Data Structures – lists, tuples, dictionaries, sets
5. Modules & Libraries – imports, common built-in functions
6. Basic Object-Oriented Concepts – classes, objects, methods,
attributes
7. File Handling & Exception Handling
• Format:
o Multiple-choice, single correct answer
o Each question includes rationale for learning reinforcement
,2
Practice Exam Questions 1–20
Python Basics
1. Which of the following is the correct way to declare a
variable in Python?
A. x = 10
B. int x = 10
C. var x = 10
D. x := 10
Answer: A
Rationale: Python uses dynamic typing; variables are assigned
using = without specifying type.
2. Which of the following is a valid Python data type?
A. list
B. array
C. vector
D. record
Answer: A
Rationale: list is a built-in mutable sequence type; Python does
not have native array or vector.
,3
3. What is the output of print(type(3.14))?
A. <class 'float'>
B. <class 'int'>
C. <class 'double'>
D. <class 'decimal'>
Answer: A
Rationale: 3.14 is a floating-point number, represented by float
in Python.
4. What symbol is used for exponentiation in Python?
A. **
B. ^
C. *
D. %
Answer: A
Rationale: ** is the exponentiation operator in Python (2**3 =
8).
5. Which of these is a valid string in Python?
A. "Hello, World!"
B. Hello, World!
C. 'Hello, World!
D. Hello, World!
, 4
Answer: A
Rationale: Strings must be enclosed in single or double quotes.
6. Which Python keyword is used to define a function?
A. def
B. function
C. func
D. define
Answer: A
Rationale: Functions are defined using the def keyword.
7. What is the result of len([1, 2, 3, 4])?
A. 4
B. 3
C. 5
D. 1
Answer: A
Rationale: len() returns the number of elements in a list.
8. Which operator is used for integer division in Python?
A. //
B. /