1/11
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
difference
removes elements in one set based on the other
intersect
combines common elements in both sets
symmetric difference
identifies elements present in only one set
superset
Tests if a set that contains all elements of another set (and possibly more)
union
combines elements in both sets
subset
Tests if every element of one set is also in another set
Select all the statements that are TRUE about a dictionary
A tuple can be a key in a dictionary
keys must be immutable in a dictionary
A string can be a key in a dictionary
The values of a dictionary must be unique
False
johns_class = set(["Monday", "Wednesday"])
marys_class = set([ "Tuesday", "Thursday"])
common_days = johns_class & marys_class
print(len(common_days))
What is the output of the above code?
0
johns_class = set(["Monday", "Wednesday"])
marys_class = set([ "Tuesday", "Thursday"])
all_days = johns_class | marys_class
print(len(all_days ))
What is the output of the above code?
4
johns_class = set(["Monday", "Wednesday"])
marys_class = set([ "Tuesday", "Thursday"])
diff_days = johns_class - marys_class
print(len(diff_days ))
What is the output of the above code?
2
johns_class = set(["Monday", "Wednesday"])
marys_class = set([ "Tuesday", "Thursday"])
exclusive_days = johns_class ^ marys_class
print(len(exclusive_days ))
What is the output of the above code?
4