IT AUTOMATION · OBJECTIVE ASSESSMENT
WGU D522 Objective Assessment (New 2026/2027 Update)
Python for IT Automation | Qs & As | Grade A | 100% Correct
(Verified Answers) — 2026/2027 — Complete
Official Exam
50 Questions Full Rationales Verified Answers
50 5 100%
QUESTIONS SECTIONS RATIONALES
WHAT THIS COVERS
01 PYTHON SYNTAX, TYPES & OPERATORS
02 DATA STRUCTURES & CONTROL FLOW
03 FUNCTIONS, MODULES & ERROR HANDLING
04 FILES, PROCESSES & OS AUTOMATION
05 SCRIPTING WORKFLOWS, APIS & SCHEDULED TASKS
ABOUT THIS ASSESSMENT
This assessment is an original study resource prepared for focused exam review. Every question, answer
option, and rationale was authored specifically for this 2026/2027 edition and mapped to high-yield topics from
the published Python for IT Automation curriculum outline. Work through all five sections, read each rationale
closely, and spend your remaining study time on the concepts you miss. Answer every item before opening the
key for the most accurate picture of your readiness.
PASSING SCORE LEVEL FORMAT
70% Undergraduate — Information Technology Multiple Choice (PDF)
STUVIA ACTUAL EXAM Page 1
,SECTION 01 PYTHON SYNTAX, TYPES & OPERATORS
Q1. A help-desk script evaluates print(17 // 5, 17 % 5) to split incoming tickets evenly across five queues.
What does the interpreter display?
A. 3.4 2, since floor division returns a float.
B. 3 3.4, since modulo converts its result to a float.
C. 4 2, since floor division rounds to the nearest integer.
D. 3 2, since floor division discards the remainder and modulo keeps it.
Correct Answer: D
Rationale: The // operator floors the quotient of 17 and 5 to 3, while % returns the remainder 2. Both operators return integers
when both operands are integers.
Q2. A junior developer tries to correct a report header with the statement header[0] = 'J' after assigning
header = 'status', and the program stops immediately. What causes the failure?
A. Strings are immutable, so individual characters cannot be reassigned.
B. The index 0 is outside the range of any string.
C. Assignment to variables requires the global keyword.
D. The letter J is not a valid string character.
Correct Answer: A
Rationale: String objects cannot be modified after creation, so item assignment raises a TypeError. Producing a corrected
header requires building a new string, for example with slicing or concatenation.
Q3. A validation routine receives values from a form and must accept any integer, including booleans that
arrive from checkboxes. A reviewer asks what isinstance(True, int) returns and why it matters. What is the
correct answer?
A. False, because booleans are a completely separate type family.
B. True, because isinstance converts booleans to integers first.
C. It raises an error, since isinstance refuses boolean arguments.
D. True, because bool is a subclass of int in the Python type system.
Correct Answer: D
Rationale: In Python, bool inherits from int, so True and False are instances of int and behave as 1 and 0 in arithmetic. Code
that must exclude booleans needs an explicit extra check.
STUVIA ACTUAL EXAM Page 2
, Q4. An invoice script formats a total with the f-string f'{total:.2f}' where total = 7. What exact string is
produced?
A. 7, because the trailing zeros are trimmed by default.
B. 7.00, because the format spec forces two decimal places.
C. 7.0, because one decimal place is the f-string default.
D. 7.2, because the spec digits become literal text.
Correct Answer: B
Rationale: The .2f specification formats the number as a fixed-point value with exactly two digits after the decimal point.
Integers are therefore rendered with two padded zeros.
Q5. A config loader contains the line value = loaded or 'default.yaml' and loaded sometimes arrives as an
empty list. What does the expression evaluate to in that case?
A. An empty list, because or always returns its first operand.
B. None, because or converts empty containers to None.
C. default.yaml, because an empty list is falsy and or returns the second operand.
D. default.yaml, because or compares memory addresses.
Correct Answer: C
Rationale: The or operator short-circuits: if the first operand is falsy, it evaluates and returns the second. Empty containers,
zero, and empty strings are all falsy in Python.
Q6. A reviewer examines the statements a = [1, 2] and b = [1, 2] and then asks about the results of a == b
and a is b. What should the reviewer expect?
A. True and False, because equality compares contents while is compares identity.
B. True and True, because equal objects are always the same object.
C. False and True, because identity implies different contents.
D. False and False, because separate literals never compare equal.
Correct Answer: A
Rationale: The == operator tests value equality between the two lists' elements. The is operator tests object identity, and two
separately constructed lists occupy different memory locations.
STUVIA ACTUAL EXAM Page 3