• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 60 pages
Exam (elaborations)

WGU D522 (WEN1) Task 1 Performance Assessment — Full Practice Exam with correct answers and rationales updated 2026

Document preview thumbnail
Preview 4 out of 60 pages

WGU D522 (WEN1) Task 1 Performance Assessment — Full Practice Exam with correct answers and rationales updated 2026

Content preview

WGU D522 (WEN1) Task 1 Performance Assessment
— Full Practice Exam with correct answers and
rationales updated 2026
Section 1: Python Fundamentals for IT Automation (Questions 1–30)


1. What is the output of the following code?


python


Copy


Download


devices = ["router01", "switch01", "modem01", "gateway01", "printer01"]


print(devices[-1])


A. router01

B. printer01

C. gateway01

D. IndexError


Answer: B

Rationale: Negative indexing in Python allows access from the end of a sequence. -1 refers

to the last element, -2 to the second-to-last. Since devices has 5 elements, devices[-

1] returns "printer01"-2.


2. What does the slice operation my_list[1:4] return?


A. Elements at indices 1, 2, 3, and 4

B. Elements at indices 1, 2, and 3 (4 is exclusive)

,C. Elements at indices 1 and 4 only

D. Elements from index 1 to the end of the list


Answer: B

Rationale: In Python slicing, the stop index is exclusive. So [1:4] includes elements at indices

1, 2, and 3. This off-by-one behavior is a common source of errors in automation scripts-2.


3. What does text[::-1] do when text = "Python"?


A. Returns "Python" unchanged

B. Returns "nohtyP" (reverses the string)

C. Returns an error

D. Returns every other character


Answer: B

Rationale: The slice [::-1] uses a negative step value, which reverses the sequence. This is a

concise Python idiom for reversing strings or lists-2.


4. How can you check if a specific value exists in a list?


A. Using the exists() method

B. Using the in keyword

C. Using the find() method

D. Using the contains() method


Answer: B

Rationale: The in keyword checks membership in sequences: if "router01" in

devices: returns True or False. Lists do not have exists() or contains() methods-2.

,5. Which data structure stores network device inventory where each device has a name, IP

address, and role?


A. A single list of all attributes

B. A list of dictionaries, where each dictionary represents a device

C. A tuple containing all devices

D. A string with comma-separated values


Answer: B

Rationale: Dictionaries allow each device to be represented with named keys

(e.g., "name", "ip", "role"), making the data self-documenting and easily accessible. This is

the standard pattern for device inventory management-2.


6. What Python data structure would you use to store unique device IP addresses without

duplicates?


A. List

B. Tuple

C. Set

D. Dictionary


Answer: C

Rationale: Sets automatically eliminate duplicate entries, making them ideal for storing

unique IP addresses. Sets also provide efficient membership testing-2-3.


7. Which approach correctly reads an integer from user input?


A. input('Enter a number:') which automatically returns an integer

B. str(input('Enter a number:')) and relying on implicit conversion

, C. int(input('Enter a number:')) to read and convert in one step

D. float(input('Enter a number:')) and truncating the decimal


Answer: C

Rationale: input() always returns a string in Python 3. int() must wrap it to convert to an

integer-2.


8. What does print() do in Python?


A. Reads user input from the console

B. Outputs text or variables to the console

C. Returns the type of an object

D. Converts a value to a string


Answer: B

Rationale: print() is the built-in function for outputting text or variables to the console-2.


9. Which code adjustment resolves a syntax error caused by missing indentation in an

if/else statement?


A. Add parentheses around the condition

B. Decrease the indentation of the else statement to match the if

C. Add a semicolon at the end of each line

D. Remove the colon after the if and else lines


Answer: B

Rationale: Python requires consistent indentation for code blocks. Misaligned else relative

to if causes an IndentationError-2.


10. What is the output of print(3 * "Hi") in Python?

Document information

Uploaded on
September 20, 2026
Number of pages
60
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$25.09

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

Sold
0
Followers
0
Items
227
Last sold
-



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