D335 / D 335 Test Sections 1 - 4 (Latest Update 2025 / 2026) Introduction to Programming in Python | Questions and Answers | Grade A | 100% Correct - WGU
Question:
set
Answer:
an unordered collection of unique elements
Question:
set literal
Answer:
written using curly braces { } with comma separating set elements
- / 4
Question:
len(set)
Answer:
Find the length (number of elements) of the set.
Question:
set1.update(set2)
Answer:
Adds the elements in set2 to set1.
Question:
set.add(value)
Answer:
Adds value into the set.
Question:
set.remove(value)
Answer:
Removes value from the set. Raises KeyError if value is not found.
- / 4
Question:
set.pop()
Answer:
Removes a random element from the set.
Question:
set.clear()
Answer:
Removes all the elements from the set
Question:
set.intersection(set_a, set_b, set_c...)
Answer:
Returns a new set containing only the elements in common between set and all provided sets.
Question:
set.union(set_a, set_b, set_c...)
Answer:
Returns a new set containing all of the unique elements in all sets. 3 / 4
Question:
set.difference(set_a, set_b, set_c...)
Answer:
Returns a set containing only the elements of set that are not found in any of the provided sets.
Question:
set_a.symmetric_difference(set_b)
Answer:
Returns a set containing only elements that appear in exactly one of set_a or set_b
Question:
dictionary
Answer:
a Python container used to describe associative relationships
Question:
key
Answer:
a term that can be located in a dictionary
- / 4