Python Set Methods Flashcards

1
Q

add()

A

Adds an element to the set

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

clear()

A

Removes all the elements from the set

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

copy()

A

Returns a copy of the set

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

difference()

A

Returns a set containing the difference between two or more sets

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

difference_update()

A

Removes the items in this set that are also included in another, specified set

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

discard()

A

Remove the specified item

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

intersection()

A

Returns a set, that is the intersection of two other sets

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

intersection_update()

A

Removes the items in this set that are not present in other, specified set(s)

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

isdisjoint()

A

Returns whether two sets have a intersection or not

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

issubset()

A

Returns whether another set contains this set or not

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

issuperset()

A

Returns whether this set contains another set or not

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

pop()

A

Removes an element from the set

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

remove()

A

Removes the specified element

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

symmetric_difference()

A

Returns a set with the symmetric differences of two sets

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

symmetric_difference_update()

A

Inserts the symmetric differences from this set and another

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

union()

A

Return a set containing the union of sets

17
Q

update()

A

Update the set with the union of this set and others