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

WGU D522 Objective Assessment | Python for IT Automation | ACTUAL EXAM | Questions & Verified Answers | Latest 2025 / 2026 Update – Western Governors University

Rating
-
Sold
-
Pages
49
Grade
A+
Uploaded on
10-12-2025
Written in
2025/2026

WGU D522 Objective Assessment | Python for IT Automation | ACTUAL EXAM | Questions & Verified Answers | Latest 2025 / 2026 Update – Western Governors University

Institution
WGU D522
Course
WGU D522











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
WGU D522
Course
WGU D522

Document information

Uploaded on
December 10, 2025
Number of pages
49
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

  • wgu d522

Content preview

WGU D522 Objective Assessment | Python for IT
Automation | ACTUAL EXAM | Questions &
Verified Answers | Latest Update –
Western Governors University

1


Which Python data type is best suited for storing a fixed collection of unique IP-address
strings that must remain immutable?


A. list


B. set


C. tuple


D. dict


Correct Answer: C


Rationale: A tuple is immutable and can contain unique strings; once created its
members cannot be reassigned, guaranteeing fixed content. A list (A) is mutable and
allows duplicates. A set (B) is mutable and unordered, so it cannot be “fixed” at runtime.
A dict (D) is mutable and requires key–value pairs, which is unnecessary overhead for a
simple collection of IPs.

,2


What is the output of the following snippet?


print(type(lambda x: x * 2))


A. <class 'function'>


B. <class 'lambda'>


C. <class 'method'>


D. <class 'builtin_function_or_method'>


Correct Answer: A


Rationale: A lambda expression creates an anonymous function object; therefore type()
returns <class 'function'>. There is no separate lambda type (B). It is neither a bound
method (C) nor a built-in (D).


3


Which statement about Python’s Global Interpreter Lock (GIL) is TRUE in CPython
3.11?


A. It allows true parallel execution of Python byte-code in multiple threads of the same
process.

,B. It is released automatically during I/O-bound operations written in Python.


C. It is bypassed when using the multiprocessing module because each process has its
own interpreter.


D. It can be disabled globally at runtime using sys.setgil(False).


Correct Answer: C


Rationale: The multiprocessing module spawns separate processes, each with its own
Python interpreter and memory space, thus avoiding the GIL. The GIL does NOT allow
parallel byte-code execution in threads (A). It is released in C extensions, not pure
Python I/O (B). No official sys.setgil(False) exists (D).


4


Which module from the Python standard library is the MOST appropriate choice for
creating a sandboxed, high-performance virtual environment without internet access?


A. zipapp


B. pyvenv


C. venv


D. ensurepip


Correct Answer: C

, Rationale: venv is the standard, lightweight module for creating virtual environments; it
supports --without-pip to remain offline. zipapp (A) packages apps but does not
sandbox. pyvenv (B) is deprecated. ensurepip (D) only bootstraps pip.


5


Given import re and the string s = "", which pattern

extracts ONLY the numeric portion of the username?


A. re.search(r'\d+', s).group()


B. re.findall(r'user(\d+)', s)[0]


C. re.match(r'.?(\d+).', s).group(1)


D. re.split(r'\D+', s)[1]


Correct Answer: A


Rationale: Pattern \d+ matches one or more digits anywhere; search finds the first
occurrence and .group() returns "123". Option B assumes literal "user" prefix. Option C
works but is verbose. Option D splits on non-digits and indexing may fail if digits appear
elsewhere.


6


Which subprocess call correctly redirects both stdout and stderr of ping -c 1

8.8.8.8 to a single file-like object while suppressing terminal output?
$13.99
Get access to the full document:

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

Get to know the seller
Seller avatar
TommyRicks

Get to know the seller

Seller avatar
TommyRicks Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
New on Stuvia
Member since
1 week
Number of followers
0
Documents
140
Last sold
-
TommyRicks

One stop shop for all all study materials, Study guides,Exams and all assignments and homeworks.

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

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

Frequently asked questions