sets Flashcards
1
Q
function to add “” to a set
A
utensils.add(“napkin”)
2
Q
function to remove from a set
A
utensils.remove(“fork”)
3
Q
function to clear a set
A
utensils.clear()
4
Q
add one set to another
A
utensils.update(dishes)
5
Q
create a new set combinging two previous sets
A
dinner_table = utensils.union(dishes)
6
Q
find the differences between sets
A
(dishes.difference(utensils))
7
Q
find the similarities between sets
A
(utensils.intersection(dishes))