• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 46 páginas
Examen

WGU D522: python for It Automation|(SKO1) Study Tips 2024/2025;(100% Guaranteed success)

Document preview thumbnail
Vista previa 4 fuera de 46 páginas

WGU D522: python for It Automation|(SKO1) Study Tips 2024/2025;(100% Guaranteed success)

Vista previa del contenido

WGU D522: python for It Automation|(SKO1)
Study Tips 2024/2025;(100% Guaranteed
success)
SECTION 1: PYTHON FUNDAMENTALS (Q1–Q30)

Q1. Which Python data type is immutable?

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

Correct Answer: C) Tuple

Rationale: Tuples are immutable — once created, elements cannot be added, removed, or
changed. Lists are mutable, dictionaries are mutable (keys must be immutable), and sets are
mutable. Immutability makes tuples suitable for dictionary keys and fixed configuration values in
automation scripts .



Q2. What does len("Automation") return?

A) 9
B) 10
C) 11
D) Error

Correct Answer: B) 10

Rationale: len() counts all characters in the string. "Automation" has 10 characters: A-u-t-o-
m-a-t-i-o-n. This function is essential for validating input lengths and processing text data from
logs or configurations .



Q3. Which statement correctly reads an integer from user input?

A) value = input("Enter: ")
B) value = int(input("Enter: "))

,C) value = float(input("Enter: "))
D) value = str(input("Enter: "))

Correct Answer: B) value = int(input("Enter: "))

Rationale: input() always returns a string in Python 3. To store an integer, you must wrap it
with int(). Option A stores a string, C stores a float, and D stores a string (str of a str is
redundant). This is critical for reading numeric configuration values or port numbers .



Q4. What is the output of print(17 // 5)?

A) 3.4
B) 3
C) 4
D) 2

Correct Answer: B) 3

Rationale: // is floor division, which returns the largest integer less than or equal to the
result. 17/5 = 3.4, floored to 3. This differs from / which returns 3.4 as a float. Floor division is
useful for calculating pagination, chunk sizes, or device ID extraction .



Q5. What is the result of 7 % 3?

A) 2
B) 1
C) 3
D) 0

Correct Answer: B) 1

Rationale: % is the modulus operator, returning the remainder. 7 divided by 3 is 2 with
remainder 1. Common uses include checking even/odd (x % 2 == 0) and cycling through values (i
% 7 to wrap indices) .



Q6. Which of the following is a valid Python identifier?

A) 2nd_device
B) device-2

,C) device_2
D) class

Correct Answer: C) device_2

Rationale: Identifiers must start with a letter or underscore, cannot contain hyphens, and
cannot be Python keywords like class. device_2 follows all rules. This matters when naming
variables in automation scripts .



Q7. What does type(3.14) return?

A) <class 'int'>
B) <class 'float'>
C) <class 'str'>
D) <class 'double'>

Correct Answer: B) <class 'float'>

Rationale: 3.14 is a floating-point number. Python has no double type — all decimal
numbers are float. Use type() to verify data types when processing values from external sources
like CSV files .



Q8. What is the output of print(bool(""))?

A) True
B) False
C) Error
D) None

Correct Answer: B) False

Rationale: Empty strings are "falsy" in Python. Non-empty strings are truthy. This is
important when validating user input or checking if a configuration value was provided .



Q9. Which operator checks for equality?

A) =
B) ==

, C) !=
D) =>

Correct Answer: B) ==

Rationale: = assigns a value; == compares for equality. Using = in a condition causes a
SyntaxError. This is one of the most common beginner mistakes and a common exam trap .



Q10. What is the output of "Hello" + " " + "World"?

A) Hello World
B) HelloWorld
C) Hello+World
D) Error

Correct Answer: A) Hello World

Rationale: The + operator concatenates strings. The space in the middle string is included.
Concatenation requires both operands to be strings — mixing str and int raises TypeError .



Q11. What does "Error: " + 404 produce?

A) Error: 404
B) TypeError
C) Error:404
D) ValueError

Correct Answer: B) TypeError

Rationale: Python does not implicitly convert types in concatenation. You must use str(404)
first. This is a frequent error when building log messages or constructing API payloads .



Q12. Which function converts a string to an integer?

A) str()
B) float()
C) int()
D) bool()

Correct Answer: C) int()

Información del documento

Subido en
27 de septiembre de 2026
Número de páginas
46
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$27.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
353
Última venta
-




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