• 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 103 pages
Exam (elaborations)

WGU D522 Python for IT Automation Exam with verified answers and rationale updated 2026 graded A+

Document preview thumbnail
Preview 4 out of 103 pages

WGU D522 Python for IT Automation Exam with verified answers and rationale updated 2026 graded A+

Content preview

Wiseman's WGU D522 Python for IT
Automation Exam with verified
answers and rationale updated 2026
graded A+

Section 1: Python Basics & Syntax (Q1–10)



1. Which function is used to display output in Python 3?



A) echo()

B) print()

C) output()

D) display()

Answer: B

Rationale: print() is Python 3's built-in function for sending output to standard output. In Python 2,
print was a statement, but Python 3 requires parentheses.



2. Which symbol begins a single-line comment in Python?



A) //

B) --

C) #

D) /*

Answer: C

Rationale: The hash/pound symbol # starts a single-line comment. // is used in C/Java, and /* */ is
for multi-line comments in those languages.



3. According to PEP 8, how many spaces should be used for indentation?

,A) 2

B) 3

C) 4

D) 8

Answer: C

Rationale: PEP 8, Python's official style guide, recommends 4 spaces per indentation level.
Consistent indentation is mandatory in Python since it defines code blocks.



4. Python is best described as which type of language?



A) Compiled and statically typed

B) Interpreted and dynamically typed

C) Compiled and dynamically typed

D) Interpreted and statically typed

Answer: B

Rationale: Python code is executed by an interpreter line-by-line, and variable types are determined
at runtime (dynamic typing), not declared in advance.



5. Which function reads input from a user?



A) read()

B) get()

C) scan()

D) input()

Answer: D

Rationale: input() pauses execution and reads a line from the user. It always returns a string, even if
the user enters numbers.



6. What data type does the input() function always return?



A) int

B) It depends on what the user types

,C) str

D) float

Answer: C

Rationale: input() always returns a string. You must explicitly convert using int() or float() if you need
numeric types.



7. Which of the following is a valid Python variable name?



A) 2nd_server

B) server-name

C) server_name

D) server name

Answer: C

Rationale: Variable names can contain letters, digits, and underscores but cannot start with a digit,
contain hyphens, or include spaces. Snake_case (server_name) is the PEP 8 convention.



8. What is the result of 7 // 2?



A) 3.5

B) 3

C) 4

D) 1

Answer: B

Rationale: The // operator performs floor division, discarding the remainder and returning the
integer portion (3), unlike / which returns 3.5.



9. What is the result of 7 % 3?



A) 2

B) 1

C) 2.33

D) 0

, Answer: B

Rationale: The modulo operator % returns the remainder of division. 7 ÷ 3 = 2 remainder 1. Modulo
is commonly used to test for even/odd numbers.



10. What does the expression 2 ** 4 evaluate to?



A) 8

B) 6

C) 16

D) 24

Answer: C

Rationale: ** is the exponentiation operator. 2⁴ = 2 × 2 × 2 × 2 = 16.



Section 2: Data Types & Variables (Q11–20)

11. Which of the following data types is immutable?



A) list

B) dictionary

C) set

D) tuple

Answer: D

Rationale: Tuples cannot be modified after creation. Lists, dictionaries, and sets are all mutable —
their contents can be changed in place.



12. What is the output of type(3.14)?



A) <class 'int'>

B) <class 'float'>

C) <class 'decimal'>

D) <class 'str'>

Answer: B

Rationale: Any number containing a decimal point is a float in Python. 3 would be an int.

Document information

Uploaded on
September 15, 2026
Number of pages
103
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$24.99

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