Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

WGU D522 Python for IT Automation 2026 Practice Questions & Verified Answers Python Scripting

Rating
-
Sold
-
Pages
80
Grade
A+
Uploaded on
16-05-2026
Written in
2025/2026

WGU D522 Python for IT Automation 2026 Practice Questions & Verified Answers Python Scripting

Institution
Course

Content preview

WGU D522 Python for IT Automation 2026 | Practice Questions & Verified
Answers | Python Scripting & Automation Prep.

Questions 1-20: Python Fundamentals & Data Types

Question 1

Which Python data type is immutable and ordered?



A) List

B) Dictionary

C) Tuple

D) Set



Answer: C

Rationale: Tuples are immutable (cannot be changed after creation) and ordered
sequences. Lists are mutable and ordered, dictionaries are mutable key-value
pairs, and sets are unordered and mutable. The immutability of tuples makes
them hashable and usable as dictionary keys .



Question 2

What is the output of print(type([]))?

,A) <class 'tuple'>

B) <class 'list'>

C) <class 'dict'>

D) <class 'set'>



Answer: B

Rationale: [] creates an empty list. The type() function returns the class type of
the object. Lists are ordered, mutable collections that allow duplicate elements .



Question 3

Which collection type automatically eliminates duplicate values?



A) List

B) Tuple

C) Dictionary

D) Set



Answer: D

Rationale: Sets are unordered collections that contain only unique items. Any
duplicate values added to a set are automatically eliminated. This makes sets

,particularly useful for filtering unique entries, such as extracting unique IP
addresses from log files .



Question 4

What is the result of int(13.9) in Python?



A) 14

B) 13.9

C) 13

D) Error



Answer: C

Rationale: When converting from a floating-point number to an integer, Python
truncates (removes) the decimal part—it does NOT round. int(13.9) returns 13. If
rounding is needed, use the round() function, which would return 14 .



Question 5

Which statement correctly creates a dictionary?



A) devices = ('Router1', '192.168.1.2')

, B) devices = ['Router1' = '192.168.1.2']

C) devices = {'Router1': '192.168.1.2', 'Switch2': '10.0.0.2'}

D) devices = {'Router1', 'Switch2'}



Answer: C

Rationale: Dictionaries in Python use curly braces {} with key-value pairs
separated by colons :. Option A creates a tuple, Option B uses incorrect syntax,
and Option D creates a set .



Question 6

What does the len() function return when called on a string?



A) The number of words in the string

B) The number of characters in the string

C) The memory size of the string

D) The number of unique characters



Answer: B

Rationale: len() returns the number of characters (including spaces and special
characters) in a string. For strings, it counts each character individually .

Written for

Institution
Course

Document information

Uploaded on
May 16, 2026
Number of pages
80
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$29.99
Get access to the full document:

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

Get to know the seller
Seller avatar
supergrader
5.0
(1)

Get to know the seller

Seller avatar
supergrader Teachme2-tutor
Follow You need to be logged in order to follow users or courses
Sold
5
Member since
9 months
Number of followers
0
Documents
1607
Last sold
3 days ago
supergrade

Welcome to supergrade Stuvia shop! We offer a wide range of high-quality study materials, including Test Banks, Study Guides, and comprehensive notes for various courses. If you’re looking for specific materials, feel free to send me a message here on Stuvia, and I’ll help you find exactly what you need. Study smarter and achieve your best results

5.0

1 reviews

5
1
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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions