• 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 2 Data Structures and Control Flow — Questions & Answers

Document preview thumbnail
Preview 3 out of 18 pages

WGU D522 Python for IT Automation Unit 2 Data Structures and Control Flow — Questions & Answers 1. What is a list in Python? A. An immutable sequence B. An unordered set C. An ordered, mutable collection of items D. A key-value mapping Answer: C. An ordered, mutable collection of items Rationale: Square brackets. 2. What is a tuple? A. A mutable list B. An ordered, immutable collection C. A key-value mapping D. An unordered set Answer: B. An ordered, immutable collection Rationale: Parentheses

Content preview

WGU D522 Python for IT Automation Unit 2
Data Structures and Control Flow — Questions
& Answers

1. What is a list in Python?
A. An immutable sequence
B. An unordered set
C. An ordered, mutable collection of items
D. A key-value mapping
Answer: C. An ordered, mutable collection of items
Rationale: Square brackets.
2. What is a tuple?
A. A mutable list
B. An ordered, immutable collection
C. A key-value mapping
D. An unordered set
Answer: B. An ordered, immutable collection
Rationale: Parentheses.
3. What is a set?
A. An ordered list
B. An unordered collection of unique items
C. A key-value mapping
D. An immutable sequence
Answer: B. An unordered collection of unique items
Rationale: Curly braces without pairs.
4. What is a dictionary?
A. An ordered list only
B. A collection of key-value pairs
C. A set of unique values
D. An immutable sequence
Answer: B. A collection of key-value pairs
Rationale: Mapping.

,5. Since which Python version do dictionaries preserve insertion order as a language
guarantee?
A. Python 2.7
B. Python 3.7
C. Python 3.0
D. Python 3.12
Answer: B. Python 3.7
Rationale: Ordered dicts.
6. What does [1, 2, 3][1] return?
A. 1
B. 3
C. Error
D. 2
Answer: D. 2
Rationale: Zero-based.
7. What does len([1, [2, 3]]) return?
A. 3
B. 1
C. 2
D. Error
Answer: C. 2
Rationale: Nested list counts as one item.
8. After x = [1, 2]; x.append(3), what is x?
A. [1, 2, 3]
B. [3, 1, 2]
C. [1, 2, [3]]
D. Error
Answer: A. [1, 2, 3]
Rationale: Append.
9. After x = [1, 2, 3]; x.insert(0, 9), what is x?
A. [9, 1, 2, 3]
B. [1, 9, 2, 3]
C. [1, 2, 3, 9]
D. [9, 2, 3]
Answer: A. [9, 1, 2, 3]
Rationale: Insert.

, 10. After x = [1, 2, 3]; x.remove(2), what is x?
A. [1, 2]
B. [1, 3]
C. [2, 3]
D. [3]
Answer: B. [1, 3]
Rationale: Removes by value.
11. What does [1, 2, 3].pop() return?
A. 1
B. 3
C. [1, 2]
D. None
Answer: B. 3
Rationale: Removes and returns last.
12. What does [1, 2, 3].index(2) return?
A. 2
B. 0
C. 3
D. 1
Answer: D. 1
Rationale: Index of value.
13. What does [1, 2] + [3] return?
A. [4, 5]
B. [[1, 2], 3]
C. Error
D. [1, 2, 3]
Answer: D. [1, 2, 3]
Rationale: Concatenation.
14. What does [0] * 3 return?
A. [0]
B. 0
C. [3]
D. [0, 0, 0]
Answer: D. [0, 0, 0]
Rationale: Repetition.
15. What does sorted([3, 1, 2]) return?
A. [1, 2, 3]
B. [3, 2, 1]
C. None
D. [3, 1, 2]
Answer: A. [1, 2, 3]
Rationale: New sorted list.

Document information

Uploaded on
November 13, 2026
Number of pages
18
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$15.49

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