1
WGU D335 — INTRODUCTION TO
PROGRAMMING IN PYTHON EXAM 2026-27
LATEST UPDATED OVERVIEW
Overview
Purpose:
This exam evaluates a student’s understanding of Python programming
fundamentals, including syntax, data structures, functions, object-oriented
programming, and debugging. It focuses on problem-solving and the ability to
write, analyze, and optimize Python code.
Content Areas:
1. Python Basics – Variables, data types, operators, input/output
2. Control Structures – Conditional statements, loops
3. Functions – Definition, parameters, return values, scope
4. Data Structures – Lists, tuples, dictionaries, sets, and string manipulation
5. Object-Oriented Programming (OOP) – Classes, objects, inheritance,
methods
6. File Handling & Exceptions – Reading/writing files, try/except
7. Algorithms & Problem-Solving – Sorting, searching, iteration, recursion
8. Debugging & Testing – Error handling and logical debugging
Format:
• 100 multiple-choice and NGN-style coding scenario questions
• Each question includes correct answer and rationale for exam preparation
,2
Section 1 — Python Basics (1–15)
1. Which of the following is a valid variable name in Python?
A. my_var
B. 2ndVar
C. my-var
D. @variable
Answer: A
Rationale: Variable names must start with a letter or
underscore and cannot include special characters.
2. What is the output of print(type(3.14))?
A. <class 'float'>
B. <class 'int'>
C. <class 'str'>
D. <class 'complex'>
Answer: A
Rationale: 3.14 is a floating-point number in Python.
,3
3. Which operator is used for exponentiation in Python?
A. **
B. ^
C. %
D. //
Answer: A
Rationale: ** raises a number to the power of another number.
4. NGN: What will be the output of print(5 + 3 * 2)?
A. 11
B. 16
C. 13
D. 10
Answer: A
Rationale: Multiplication has higher precedence than addition:
3*2=6, 6+5=11.
5. How do you write a single-line comment in Python?
A. # This is a comment
B. // This is a comment
, 4
C. /* This is a comment */
D. <!-- This is a comment -->
Answer: A
Rationale: Python uses # for single-line comments.
6. Which of the following is mutable?
A. list
B. tuple
C. str
D. int
Answer: A
Rationale: Lists can be changed after creation; tuples, strings,
and integers are immutable.
7. What is the result of len("Python")?
A. 6
B. 5
C. 7
D. 0
Answer: A
Rationale: "Python" has 6 characters.
WGU D335 — INTRODUCTION TO
PROGRAMMING IN PYTHON EXAM 2026-27
LATEST UPDATED OVERVIEW
Overview
Purpose:
This exam evaluates a student’s understanding of Python programming
fundamentals, including syntax, data structures, functions, object-oriented
programming, and debugging. It focuses on problem-solving and the ability to
write, analyze, and optimize Python code.
Content Areas:
1. Python Basics – Variables, data types, operators, input/output
2. Control Structures – Conditional statements, loops
3. Functions – Definition, parameters, return values, scope
4. Data Structures – Lists, tuples, dictionaries, sets, and string manipulation
5. Object-Oriented Programming (OOP) – Classes, objects, inheritance,
methods
6. File Handling & Exceptions – Reading/writing files, try/except
7. Algorithms & Problem-Solving – Sorting, searching, iteration, recursion
8. Debugging & Testing – Error handling and logical debugging
Format:
• 100 multiple-choice and NGN-style coding scenario questions
• Each question includes correct answer and rationale for exam preparation
,2
Section 1 — Python Basics (1–15)
1. Which of the following is a valid variable name in Python?
A. my_var
B. 2ndVar
C. my-var
D. @variable
Answer: A
Rationale: Variable names must start with a letter or
underscore and cannot include special characters.
2. What is the output of print(type(3.14))?
A. <class 'float'>
B. <class 'int'>
C. <class 'str'>
D. <class 'complex'>
Answer: A
Rationale: 3.14 is a floating-point number in Python.
,3
3. Which operator is used for exponentiation in Python?
A. **
B. ^
C. %
D. //
Answer: A
Rationale: ** raises a number to the power of another number.
4. NGN: What will be the output of print(5 + 3 * 2)?
A. 11
B. 16
C. 13
D. 10
Answer: A
Rationale: Multiplication has higher precedence than addition:
3*2=6, 6+5=11.
5. How do you write a single-line comment in Python?
A. # This is a comment
B. // This is a comment
, 4
C. /* This is a comment */
D. <!-- This is a comment -->
Answer: A
Rationale: Python uses # for single-line comments.
6. Which of the following is mutable?
A. list
B. tuple
C. str
D. int
Answer: A
Rationale: Lists can be changed after creation; tuples, strings,
and integers are immutable.
7. What is the result of len("Python")?
A. 6
B. 5
C. 7
D. 0
Answer: A
Rationale: "Python" has 6 characters.