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 – Complete OA Prep Bundle (Timed Mock Exam + Practice Questions + Full Answers) | 2026 Pass Guarantee.

Rating
-
Sold
-
Pages
156
Grade
A+
Uploaded on
01-04-2026
Written in
2025/2026

WGU D522 Python for IT Automation – Complete OA Prep Bundle (Timed Mock Exam + Practice Questions + Full Answers) | 2026 Pass Guarantee.

Content preview

,WGU D522 Python for IT Automation – Complete OA Prep Bundle (Timed
Mock Exam + Practice Questions + Full Answers) | 2026 Pass Guarantee.

1. What is the correct way to assign the integer 10 to a variable named count in
Python?

Answer: count = 10
Explanation: Python uses the assignment operator = to store a value in a variable.

2. Which data type would you use to store a sequence of characters such as
"server01"?

Answer: str
Explanation: Text values are stored as strings in Python.

3. What will this code print?
x = 5
y = 2
print(x // y)

Answer: 2
Explanation: // performs floor division, so 5 // 2 returns 2.

4. What is the purpose of indentation in Python?

Answer: It defines code blocks.
Explanation: Python uses indentation to determine which statements belong inside loops,
functions, conditionals, and other structures.

5. Which statement is used to add a comment in Python?

Answer: A line beginning with #
Explanation: Anything after # on a line is treated as a comment.

6. What is the output of:
print(type(3.14))

Answer: <class 'float'>
Explanation: 3.14 is a floating-point number.

7. Which operator is used for exponentiation in Python?

,Answer: **
Explanation: For example, 2 ** 3 evaluates to 8.

8. What does the following expression return?
10 % 3

Answer: 1
Explanation: % returns the remainder after division.

9. What is the result of:
"Py" + "thon"

Answer: "Python"
Explanation: The + operator concatenates strings.

10. Which built-in function returns the number of items in a list?

Answer: len()
Explanation: len([1,2,3]) returns 3.



11. What is a list in Python?

Answer: A mutable ordered collection of items.
Explanation: Lists can store multiple values and can be changed after creation.

12. How do you access the first element of a list named items?

Answer: items[0]
Explanation: Python uses zero-based indexing.

13. Which method adds an item to the end of a list?

Answer: .append()
Explanation: Example: items.append("router")

14. What is the difference between a list and a tuple?

Answer: A list is mutable; a tuple is immutable.
Explanation: Lists can be modified, while tuples cannot after creation.

15. Which data structure stores key-value pairs?

, Answer: Dictionary
Explanation: Dictionaries map keys to values, such as {"host": "server1"}.

16. How do you retrieve the value for key "ip" from dictionary device?

Answer: device["ip"]
Explanation: Square brackets with the key return the associated value.

17. What does device.get("ip") do?

Answer: It returns the value for "ip" if it exists, or None if it does not.
Explanation: .get() avoids a KeyError when the key is missing.

18. What kind of collection is a set?

Answer: An unordered collection of unique items.
Explanation: Sets automatically remove duplicates.

19. What is the result of:
set([1, 1, 2, 3])

Answer: {1, 2, 3}
Explanation: Duplicate values are removed in a set.

20. When would a dictionary be preferred over a list?

Answer: When you need to look up values by meaningful keys instead of numeric positions.
Explanation: Dictionaries are ideal for storing structured data like usernames, IPs, or
configurations.



21. Which keyword starts a conditional statement in Python?

Answer: if
Explanation: if checks whether a condition is true.

22. What keyword provides an alternative condition after if?

Answer: elif
Explanation: elif allows multiple conditions to be tested.

23. What keyword runs code when all previous conditions are false?

Document information

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

Subjects

  • d522
  • wgu d522
$19.99
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

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.
Wiseman NURSING
View profile
Follow You need to be logged in order to follow users or courses
Sold
8022
Member since
4 year
Number of followers
3886
Documents
29906
Last sold
10 hours ago
Premier Academic Solutions

3.9

1623 reviews

5
793
4
297
3
251
2
92
1
190

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