• 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 3 out of 18 pages
Exam (elaborations)

WGU D522 Python for IT Automation Unit 1 Python Fundamentals - Syntax, Data Types, Operators and Strings — Questions & Answ

Document preview thumbnail
Preview 3 out of 18 pages

WGU D522 Python for IT Automation Unit 1 Python Fundamentals - Syntax, Data Types, Operators and Strings — Questions & Answers 1. What is Python? A. A high-level, interpreted, general-purpose programming language B. A compiled low-level language C. A database D. An operating system Answer: A. A high-level, interpreted, general-purpose programming language Rationale: Created by Guido van Rossum. 2. Why is Python popular for IT automation? A. It only runs on Windows B. It requires no interpreter C. Readable syntax, a large standard library and many third-party packages D. It's a hardware language Answer: C. Readable syntax, a large standard library and many third-party packages Rationale: Batteries included.

Content preview

WGU D522 Python for IT Automation Unit 1
Python Fundamentals - Syntax, Data Types,
Operators and Strings — Questions & Answers

1. What is Python?
A. A high-level, interpreted, general-purpose programming language
B. A compiled low-level language
C. A database
D. An operating system
Answer: A. A high-level, interpreted, general-purpose programming language
Rationale: Created by Guido van Rossum.
2. Why is Python popular for IT automation?
A. It only runs on Windows
B. It requires no interpreter
C. Readable syntax, a large standard library and many third-party packages
D. It's a hardware language
Answer: C. Readable syntax, a large standard library and many third-party
packages
Rationale: Batteries included.
3. What is the current major version of Python in use?
A. Python 3
B. Python 2
C. Python 1
D. Python 4
Answer: A. Python 3
Rationale: Python 2 reached end of life in 2020.
4. How does Python define code blocks?
A. Curly braces
B. Semicolons
C. Indentation
D. Keywords BEGIN and END
Answer: C. Indentation
Rationale: Whitespace matters.

,5. How many spaces does PEP 8 recommend per indentation level?
A. 2
B. 8
C. 4
D. 1
Answer: C. 4
Rationale: Style guide.
6. What is PEP 8?
A. Python's official style guide
B. A Python version
C. A package manager
D. A testing tool
Answer: A. Python's official style guide
Rationale: Readability.
7. Which symbol starts a single-line comment in Python?
A. //
B. --
C. /*
D. #
Answer: D. #
Rationale: Comments.
8. What is a docstring?
A. A string literal at the start of a module, function or class describing it
B. A comment with #
C. A variable
D. An error message
Answer: A. A string literal at the start of a module, function or class describing
it
Rationale: Documentation.
9. What function displays output to the console?
A. input()
B. echo()
C. print()
D. display()
Answer: C. print()
Rationale: Output.

, 10. What function reads user input from the keyboard?
A. print()
B. read()
C. input()
D. scan()
Answer: C. input()
Rationale: Returns a string.
11. What data type does input() return?
A. int
B. float
C. bool
D. str
Answer: D. str
Rationale: Always a string.
12. What is a variable in Python?
A. A fixed constant only
B. A function
C. A name that refers to a value stored in memory
D. A module
Answer: C. A name that refers to a value stored in memory
Rationale: Assignment.
13. Which is a valid Python variable name?
A. 2servers
B. server_count
C. server-count
D. class
Answer: B. server_count
Rationale: Rules.
14. Why is "class" not a valid variable name?
A. It's too short
B. It contains no digits
C. It's uppercase
D. It's a reserved keyword
Answer: D. It's a reserved keyword
Rationale: Keywords.
15. What naming convention does PEP 8 recommend for variables and functions?
A. snake_case
B. camelCase
C. PascalCase
D. UPPERCASE
Answer: A. snake_case
Rationale: Style.

Document information

Uploaded on
November 13, 2026
Number of pages
18
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$15.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

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.
ARVEX
3.0
(1)
Sold
12
Followers
0
Items
3233
Last sold
1 week 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