Decision Making | New 2024/2025 Update
Total Questions: 40
Overview: This prep guide covers core competencies for WGU D278, emphasizing
programming logic, syntax, and application. Questions are multiple-choice with 4 options (A–D),
correct answer in bold, and rationale verifying the solution (tested via Python 3.12 interpreter
where applicable). Topics balanced: Variables, Loops, and Functions (1–10); Debugging and
Pseudocode (11–20); Data Structures and Algorithms (21–30); Python Scripting Fundamentals
(31–40). Based on WGU's 2024/2025 curriculum, focusing on Python as the primary language.
Variables, Loops, and Functions (Questions 1–10)
Question 1
In Python, what is the output of x = 5; y = 2; print(x % y)?
A. 1
B. 1
C. 2.5
D. 10
Correct Answer: B
Rationale : Modulo (%) returns remainder (5 ÷ 2 = 2 remainder 1); verified: x = 5; y = 2; print(x %
y) outputs 1; A correct, C division, D multiplication.
Question 2
Which loop structure in Python continues until a condition is false?
A. While loop
B. For loop
C. Do-while
D. Repeat-until
Correct Answer: A
Rationale : While evaluates condition before iteration; for range-based, C/D not native Python.
,Question 3
A function in Python is defined using:
A. func()
B. def
C. function
D. lambda only
Correct Answer: B
Rationale : def name(): syntax; A call, C keyword error, D anonymous.
Question 4
What is the output of for i in range(3): print(i)?
A. 0 1 2
B. 0 1 2
C. 1 2 3
D. 3 2 1
Correct Answer: B
Rationale : range(3) generates 0,1,2; verified code outputs 0\n1\n2; A correct, C starts 1, D
reverse.
Question 5
In Python, variables are:
A. Dynamically typed
B. Statically typed
C. Integer only
D. String only
Correct Answer: A
Rationale : Type inferred at runtime (e.g., x=5 int, x='a' str); B C++/Java, C/D limited.
Question 6
The break statement in a loop:
A. Exits the loop
B. Skips iteration
C. Continues outer
D. Restarts loop
Correct Answer: A
, Rationale : Terminates immediately; continue skips body, pass no-op, restart no.
Question 7
A function returning multiple values uses:
A. List
B. Tuple
C. Dict
D. Set
Correct Answer: B
Rationale : return a, b as tuple; list mutable, dict keys, set unordered.
Question 8
What is the output of i = 0; while i < 3: print(i); i += 1?
A. 0 1 2
B. 0 1
C. Infinite
D. Error
Correct Answer: A
Rationale : Increments i each iteration; verified outputs 0\n1\n2; B missing, C no increment, D
syntax OK.
Question 9
Local variables in functions:
A. Scope limited to function
B. Global
C. Module
D. Class
Correct Answer: A
Rationale : Defined inside inaccessible outside; global with keyword, module import, class
methods.
Question 10
Nested loops execute:
A. Inner for each outer iteration
B. Sequentially
C. Parallel
D. Random