100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

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

Puntuación
-
Vendido
-
Páginas
47
Grado
A+
Subido en
10-12-2025
Escrito en
2025/2026

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

Institución
WGU D522
Grado
WGU D522











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
WGU D522
Grado
WGU D522

Información del documento

Subido en
10 de diciembre de 2025
Número de páginas
47
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

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 throughout the script?


A. list


B. set


C. tuple


D. dict


Correct Answer: C


Rationale: A tuple (C) is immutable and can hold unique strings; using it prevents accidental
mutation and conveys intent that the collection should not change. A list (A) is mutable and
allows duplicates. A set (B) is mutable and unordered, making it unsuitable when order must be
preserved. A dict (D) is mutable and keyed, which is unnecessary for a simple collection.


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 'int'>


Correct Answer: A


Rationale: In Python a lambda expression creates an anonymous function object whose runtime
type is function (A). There is no separate lambda type (B). It is neither a bound method (C) nor
an integer (D).


3.​ Which statement accurately describes the difference between a Python module and a

package?


A. A module is a single .py file; a package is a directory containing an init.py file and possibly
sub-modules.


B. A module can contain multiple packages; a package cannot contain modules.


C. There is no difference; the terms are interchangeable.


D. A package must be compiled before use, whereas a module is interpreted.


Correct Answer: A

,Rationale: A module is indeed a single file (A), while a package is a directory with an init.py
marker that can contain sub-modules or sub-packages. Option B reverses the relationship. Option
C is false. Option D confuses packages with compiled extensions.


4.​ Which exception will be raised if subprocess.run(['ping', '-c', '1',

'192.168.1.1'], check=True) receives no reply from the target?


A. ConnectionError


B. subprocess.CalledProcessError


C. TimeoutError


D. OSError


Correct Answer: B


Rationale: When check=True the shell return-code becomes an exception; ping returns

non-zero on no reply, raising CalledProcessError (B). ConnectionError (A) is for

sockets. TimeoutError (C) requires a timeout parameter. OSError (D) is too generic and

not triggered here.


5.​ Which re pattern correctly matches an IPv4 dotted-quad address in a log line?



A. r'\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}'


B. r'[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}'

, C. r'\d+.\d+.\d+.\d+'


D. r'(\d{1,3}.){3}\d{1,3}'


Correct Answer: D


Rationale: Pattern D groups three repetitions of digits followed by a dot and then a final digit
group, efficiently matching dotted quads. A and B are verbose but correct; D is more compact. C
is too greedy and could match invalid lengths.


6.​ Which pathlib method returns a new Path object with the file suffix changed?



A. with_suffix()


B. suffix()


C. rename()


D. replace_suffix()


Correct Answer: A


Rationale: Path.with_suffix('.new') (A) returns a new Path object with the extension

altered without renaming the file itself. suffix (B) is a read-only property. rename() (C)

moves/renames the actual file. There is no replace_suffix() (D).



7.​ What is the purpose of if __name__ == '__main__': in a Python automation

script?
$14.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
TommyRicks

Conoce al vendedor

Seller avatar
TommyRicks Chamberlain College Of Nursing
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
Nuevo en Stuvia
Miembro desde
3 semanas
Número de seguidores
0
Documentos
280
Última venta
-
TommyRicks

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

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes