Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

WGU D522 Python for IT Automation OA Actual Exam 2026/2027 – Verified Q&A – 100% Correct – Detailed Rationales – Pass Guaranteed – A+ Graded

Rating
-
Sold
-
Pages
24
Grade
A+
Uploaded on
13-04-2026
Written in
2025/2026

Pass the WGU D522 Python for IT Automation Objective Assessment with this 2026/2027 complete actual exam featuring verified Q&A that are 100% correct. Covers key topics including Python syntax, data structures, file handling, exception handling, regular expressions, and automation scripts. Each answer includes detailed rationales to reinforce IT automation programming competencies. Backed by our Pass Guarantee. Download now.

Show more Read less
Institution
WGU D522 Python For IT Automation
Course
WGU D522 Python for IT Automation

Content preview

WGU D522 Python for IT Automation OA Actual
Exam 2026/2027 – Verified Q&A – 100%
Correct – Detailed Rationales – Pass
Guaranteed – A+ Graded


Python Fundamentals & Data Types

Q1: You're writing a script to process user input from a web form. The input arrives as
the string "42.5" and you need to perform mathematical calculations on it. Which
conversion ensures you maintain decimal precision for accurate financial calculations?
A. int("42.5") to ensure whole number arithmetic
B. float("42.5") to preserve the decimal component [CORRECT]
C. str("42.5") to maintain the original formatting
D. bool("42.5") to validate the input exists
Correct Answer: B
Rationale: The float() function converts a string to a floating-point number, preserving
decimal precision needed for financial calculations. int() would truncate the decimal
and raise a ValueError if the string contains a decimal point, while str() and bool() don't
provide numeric types suitable for math operations.


Q2: A junior developer on your team asks why their variable name 2nd_user is
throwing a syntax error. Which explanation correctly identifies the Python naming rule
being violated?
A. Variable names cannot contain underscores
B. Variable names cannot begin with a number [CORRECT]
C. Variable names must be all uppercase
D. Variable names cannot contain the letter 'd'
Correct Answer: B

,Rationale: Python variable names must start with a letter or underscore, never a
number. While underscores are allowed and encouraged for readability (snake_case),
starting with a digit violates lexical rules and raises a SyntaxError immediately upon
parsing.


Q3: Examine this expression: result = 10 + 5 * 2 ** 2 - . What value
does result hold after evaluation?
A. 17.0
B. 26.0
C. 28.0 [CORRECT]
D. 12.0
Correct Answer: C
Rationale: Following PEMDAS (Python operator precedence), exponentiation happens
first (2**2=4), then multiplication/division left-to-right (5*4=20, 8/4=2.0), then
addition/subtraction left-to-right (10+20-2.0=28.0). The division operation promotes the
result to a float.

Q4: You're debugging a configuration script that unexpectedly modifies shared settings.
You suspect the issue relates to how Python handles data types. Which pair correctly
identifies a mutable type that might cause this unexpected behavior when passed
between functions, versus an immutable alternative?
A. tuple (mutable) and list (immutable)
B. list (mutable) and tuple (immutable) [CORRECT]
C. string (mutable) and dictionary (immutable)
D. integer (mutable) and float (immutable)
Correct Answer: B
Rationale: Lists are mutable objects that can be modified in-place after creation,
causing unintended side effects when passed to functions that modify them. Tuples are
immutable sequences that cannot be changed after creation, making them safer for
shared configuration data. Strings, integers, and floats are also immutable, while
dictionaries are mutable.

, Q5: A system monitor script needs to check if two conditions are met: disk_usage is
below 90% AND either cpu_load is below 80% OR memory_pressure is False. Given
disk_usage=85, cpu_load=85, memory_pressure=False, what does this evaluate to?
A. False because cpu_load exceeds 80%
B. True because disk_usage is below 90% and memory_pressure provides the necessary
True condition [CORRECT]
C. False because both cpu_load and memory_pressure must be favorable
D. True only if disk_usage is below 80%
Correct Answer: B
Rationale: The expression evaluates as: (disk_usage < 90) AND ((cpu_load < 80) OR (not
memory_pressure)). With the given values: True AND (False OR True) → True AND True
→ True. The OR operator only requires one true condition, so the favorable
memory_pressure saves the evaluation despite high CPU load.

Q6: Your automation script calculates monetary values and you're seeing unexpected
results when adding 0.1 + 0.2. Which statement best explains this common Python
behavior and the appropriate solution?
A. Python cannot perform decimal arithmetic without external libraries
B. Floats use binary representation causing precision errors; use the decimal module for
financial calculations [CORRECT]
C. The sum equals exactly 0.3 but print statements round it
D. Integers should be used by multiplying all values by 100
Correct Answer: B
Rationale: Floating-point numbers use binary fractions which cannot precisely represent
decimal values like 0.1 or 0.2, causing rounding errors (0.30000000000000004). For
financial calculations requiring exact decimal precision, Python's decimal module
provides Decimal objects that avoid these binary representation issues.

Q7: You need to determine if a user-provided year is a leap year using the standard
algorithm: divisible by 4, except if divisible by 100 unless also divisible by 400. Which
operator combination correctly implements this logic?
A. year / 4 == 0 and year / 100 != 0 or year / 400 == 0
B. year % 4 == 0 and year % 100 != 0 or year % 400 == 0 [CORRECT]
C. year // 4 == 0 and year // 100 != 0
D. year ** 4 == 0
Correct Answer: B

Written for

Institution
WGU D522 Python for IT Automation
Course
WGU D522 Python for IT Automation

Document information

Uploaded on
April 13, 2026
Number of pages
24
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$13.50
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
PrimeScholars Rasmussen college
Follow You need to be logged in order to follow users or courses
Sold
32
Member since
1 year
Number of followers
0
Documents
2210
Last sold
3 hours ago
ExamPrep Hub

ExamPrep Hub delivers premium expertly curated exam materials designed for serious students who aim for top performance. our resources are structured for clarity, accuracy, and efficiency helping you master concept, revise smarter and achieve outstanding result

4.0

6 reviews

5
4
4
0
3
1
2
0
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions