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
Document preview thumbnail
Preview 2 out of 13 pages
Exam (elaborations)

WGU D522 Python for IT Automation OA Actual Exam Style 2026/2027 | Questions with Verified Answers 100% Correct | Pass Guaranteed | Grade A

Document preview thumbnail
Preview 2 out of 13 pages

This document contains real WGU D522 Python for IT Automation Objective Assessment exam questions for the 2026/2027 cycle, with verified answers that are 100% correct. It covers core Python automation concepts including scripting fundamentals, file handling, functions, loops, error handling, and automation use cases relevant to IT workflows. The material mirrors real OA exam-style questions to support accurate preparation and confident performance.

Content preview

WGU D522 Python for IT Automation OA
Actual Exam Style 2026/2027 | Questions
with Verified Answers 100% Correct | Pass
Guaranteed | Grade A

Q01 What is the correct way to create a string variable named message with the value "Welcome
to Python"? Answer: message = "Welcome to Python" Rationale: Strings in Python are
created using single quotes (' '), double quotes (" "), or triple quotes. Double quotes are the most
common and readable style.



Q02 Which function is used to display output in Python? Answer: print() Rationale: The
print() function is the standard way to output text or variables to the console. Parentheses are
required.



Q03 What is the output of the following code?

Python
x = 10
y = 4
print(x % y)

Answer: 2 Rationale: The % operator returns the remainder of division. 10 divided by 4 is 2
with a remainder of 2.



Q04 Which of the following is NOT a valid variable name in Python? Answer: 2var Rationale:
Variable names cannot start with a number. They must begin with a letter (a–z, A–Z) or
underscore (_), followed by letters, numbers, or underscores.



Q05 What will be the result of this code?

, Python
text = "Automation"
print(text[3:7])

Answer: omat Rationale: String slicing [start:end] includes the start index (3) but excludes the
end index (7). Characters at positions 3, 4, 5, 6 → o, m, a, t.



Q06 Which operator is used for equality comparison in Python? Answer: == Rationale: ==
checks if two values are equal. The single = is used for assignment only.



Q07 What is the correct syntax to create a list containing the values 5, 10, and 15? Answer:
values = [5, 10, 15] Rationale: Lists are created using square brackets [] with comma-separated
values.



Q08 What is the output of this expression?

Python
True and False or True

Answer: True Rationale: Python evaluates from left to right with and having higher precedence
than or. True and False = False → False or True = True.



Q09 Which keyword is used to define a function in Python? Answer: def Rationale: Functions
are defined using the def keyword, followed by the function name, parameters (if any), and a
colon.



Q10 What will this loop print?

Python
for num in range(4):
print(num)

Answer: 0 1 2 3 Rationale: range(4) generates numbers from 0 up to (but not including) 4 → 0,
1, 2, 3.

Document information

Uploaded on
January 6, 2026
Number of pages
13
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.49

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

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.
StuviaFastPass
3.2
(38)
Sold
280
Followers
83
Items
3458
Last sold
1 day ago


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