Set Methods Flashcards

1
Q

Definition set

A

A collection that is unordered and unindexed.

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

set.add()

A

Add an element to the set.

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

set.clear()

A

Removes all elements from the set.

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

set.copy()

A

Returns a copy of the set.

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

set.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
6
Q

set.difference_update()

A

Removes the items in the set that are also included in another specified set.

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

set.discard()

A

Removes the specified item.

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

set.intersection()

A

Returns the intersection of two other sets.

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

set.intersection_update()

A

Removes the items in this set not present in the other.

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

set.isdisjoint()

A

Returns true if the sets do not intersect.

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

set.issubset()

A

Returns true if it is a subset.

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

set.issuperset()

A

Returns true if this set contains another set.

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

set.pop()

A

Removes an element from the set.

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

set.remove()

A

Removes the specified element.

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

set.symmetric_difference()

A

Returns a set with the symmetric difference of two sets

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

set.symmetric_difference_update()

A

Inserts the symmetric differences from this set to another.

17
Q

set.union()

A

Returns a union of the sets.

18
Q

set.update()

A

Update this set with the union of this set and others.