sets Flashcards

1
Q

function to add “” to a set

A

utensils.add(“napkin”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

function to remove from a set

A

utensils.remove(“fork”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

function to clear a set

A

utensils.clear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

add one set to another

A

utensils.update(dishes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

create a new set combinging two previous sets

A

dinner_table = utensils.union(dishes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

find the differences between sets

A

(dishes.difference(utensils))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

find the similarities between sets

A

(utensils.intersection(dishes))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly