100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

WGU D522 |OA| OBJECTIVE ASSESSMENT (LATEST UPDATE) PYTHON FOR IT AUTOMATION| EXAM QUESTIONS AND ANSWERS | FULLY SOLVED

Rating
-
Sold
-
Pages
56
Grade
A+
Uploaded on
03-02-2026
Written in
2025/2026

WGU D522 |OA| OBJECTIVE ASSESSMENT (LATEST UPDATE) PYTHON FOR IT AUTOMATION| EXAM QUESTIONS AND ANSWERS | FULLY SOLVED

Institution
Module

Content preview

WGU D522 |OA| OBJECTIVE
ASSESSMENT (LATEST UPDATE)
PYTHON FOR IT AUTOMATION| EXAM
QUESTIONS AND ANSWERS



1. What is the primary advantage of using dictionaries in Python?

A. They store data in sorted order
B. They allow key–value associations
C. They allow duplicate keys
D. They store only numeric data

✅ Correct Answer: B

Explanation:
Dictionaries allow values to be associated with descriptive keys, making data easy to
access and manage. This structure is ideal for representing relationships such as device
names and IP addresses. Dictionaries are widely used in IT automation because they
improve readability and efficiency. Keys must be unique, but values can be duplicated.



2. Which symbol is used to define a dictionary in Python?

A. []
B. ()
C. {}
D. <>

✅ Correct Answer: C

Explanation:
Python dictionaries are defined using curly braces {}. Inside the braces, key–value pairs
are separated by commas. Each key is separated from its value using a colon. This syntax

,distinguishes dictionaries from lists and tuples.



3. Which of the following is a valid dictionary key type?

A. List
B. Dictionary
C. Tuple
D. Set

✅ Correct Answer: C

Explanation:
Dictionary keys must be immutable, meaning they cannot change after creation. Tuples
are immutable and therefore valid dictionary keys. Lists and dictionaries are mutable
and cannot be used as keys. Sets are also mutable and invalid as keys.



4. What will happen if duplicate keys are used in a dictionary?

A. Python raises an error
B. Both values are stored
C. The first value is kept
D. The last value overwrites the earlier one

✅ Correct Answer: D

Explanation:
When duplicate keys are used, Python keeps only the last assigned value. The earlier
value is overwritten without warning. This behavior ensures each key remains unique.
Developers must be careful to avoid unintentional overwrites.



5. Which method is used to retrieve all keys from a dictionary?

A. getkeys()
B. keys()
C. values()
D. items()

✅ Correct Answer: B

,Explanation:
The keys() method returns a view object containing all dictionary keys. This is useful
when iterating through keys in automation scripts. The returned object updates
dynamically if the dictionary changes. It does not return values or key–value pairs.



6. What does the values() method return?

A. Only dictionary keys
B. Only dictionary values
C. Key–value pairs
D. Sorted dictionary

✅ Correct Answer: B

Explanation:
The values() method returns all values stored in a dictionary. It does not include keys.
This method is helpful when analyzing or processing stored data without needing the
keys. The returned object reflects live changes to the dictionary.



7. How do you safely access a dictionary value without raising an
error?

A. Using square brackets
B. Using find()
C. Using get()
D. Using search()

✅ Correct Answer: C

Explanation:
The get() method allows safe access to dictionary values. If the key does not exist, it
returns None or a specified default value instead of raising an error. This is especially
useful in automation scripts where missing keys are possible. It improves script stability.



8. What will dict.get("missing") return if the key does not exist?

, A. Error
B. 0
C. Empty string
D. None

✅ Correct Answer: D

Explanation:
If a key is not found, the get() method returns None by default. This prevents runtime
errors and allows the script to continue running. A custom default value can also be
specified. This behavior is safer than direct indexing.



9. How can you add a new key-value pair to a dictionary?

A. Using append()
B. Using add()
C. Assigning a value to a new key
D. Using insert()

✅ Correct Answer: C

Explanation:
A new key-value pair is added by directly assigning a value to a new key. Python
automatically adds the key if it does not exist. This approach is simple and efficient. It is
commonly used in configuration automation.



10. What does the update() method do in a dictionary?

A. Deletes keys
B. Adds or modifies key-value pairs
C. Sorts the dictionary
D. Copies the dictionary

✅ Correct Answer: B

Explanation:
The update() method merges another dictionary into the current one. Existing keys are
updated, and new keys are added. This is useful when combining configuration data. It

Written for

Institution
Module

Document information

Uploaded on
February 3, 2026
Number of pages
56
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

£16.21
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


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.
millyphilip West Virginia University
Follow You need to be logged in order to follow users or courses
Sold
2842
Member since
3 year
Number of followers
1957
Documents
42083
Last sold
4 hours ago
white orchid store

EXCELLENCY IN ACCADEMIC MATERIALS ie exams, study guides, testbanks ,case, case study etc

3.7

542 reviews

5
236
4
86
3
103
2
31
1
86

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 exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions