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
Document preview thumbnail
Preview 4 out of 38 pages
Exam (elaborations)

WGU D522: Python for IT Automation OA Practice Exam| Complete Exam Questions with Verified Correct Answers and Detailed Explanations – Latest Update 2026/2027 | Graded A+

Document preview thumbnail
Preview 4 out of 38 pages

WGU D522: Python for IT Automation OA Practice Exam| Complete Exam Questions with Verified Correct Answers and Detailed Explanations – Latest Update 2026/2027 | Graded A+

Content preview

WGU D522: Python for IT Automation OA Practice Exam|
Complete Exam Questions with Verified Correct Answers and
Detailed Explanations – Latest Update 2026/2027 | Graded A+


1. Which statement best describes Python variables?

A. Variables must be declared with a data type before use
B. Variables are created when a value is assigned to them
C. Variables can only store strings
D. Variables cannot change values

✅ Correct Answer: B — Variables are created when a value is assigned
to them

Explanation:
Python uses dynamic typing. A variable does not require a prior declaration;
assigning a value automatically creates the variable and determines its type.



2. Which symbol is used for comments in Python?

A. //
B.
C. #
D. **

✅ Correct Answer: C — #

Explanation:
Python uses the hash symbol (#) to create single-line comments. Comments
are ignored during program execution.



3. What is the output of the following code?

x=5
y=2

,print(x + y)

A. 52
B. 7
C. 3
D. Error

✅ Correct Answer: B — 7

Explanation:
The plus operator performs mathematical addition when used with integers.



4. Which Python data type stores multiple ordered values and can be
modified?

A. Tuple
B. String
C. List
D. Set

✅ Correct Answer: C — List

Explanation:
Lists are ordered collections that are mutable, meaning items can be added,
removed, or changed.



5. Which data structure cannot be modified after creation?

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

✅ Correct Answer: C — Tuple

,Explanation:
Tuples are immutable collections. Once created, their values cannot be
changed.



6. What does the following code produce?

numbers = [10,20,30]
print(numbers[1])

A. 10
B. 20
C. 30
D. Error

✅ Correct Answer: B — 20

Explanation:
Python indexing starts at 0. Index 1 refers to the second element.



7. Which statement is used to make decisions in Python?

A. switch
B. if
C. choose
D. decision

✅ Correct Answer: B — if

Explanation:
The if statement allows a program to execute code based on whether a
condition is true.



8. What is the purpose of an elif statement?

A. Creates a loop
B. Adds another conditional branch

, C. Defines a function
D. Imports a module

✅ Correct Answer: B — Adds another conditional branch

Explanation:
elif means "else if" and allows multiple conditions to be evaluated.



9. Which loop is commonly used to iterate through a list?

A. repeat loop
B. foreach loop
C. for loop
D. iterate loop

✅ Correct Answer: C — for loop

Explanation:
Python's for loop is designed to iterate through sequences such as lists,
strings, and tuples.



10. What does the range() function generate?

A. Random numbers
B. A sequence of numbers
C. A list of files
D. A dictionary

✅ Correct Answer: B — A sequence of numbers

Explanation:
range() generates a sequence commonly used with loops.

Example:

for i in range(5):
print(i)

Document information

Uploaded on
July 25, 2026
Number of pages
38
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.69

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

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Elitestudyvault
4.5
(4)
Sold
16
Followers
3
Items
938
Last sold
6 days ago


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