Set Methods Flashcards
1
Q
remove()
A
removes element from the set
2
Q
add()
A
adds element to a set
3
Q
copy()
A
returns shallow copy of a set
4
Q
clear()
A
remove all elements from a set
5
Q
difference()
A
returns difference of two sets
6
Q
difference_update()
A
updates calling set with intersection of sets
7
Q
discard()
A
removes an element from the set
8
Q
intersection()
A
returns intersection of two or more sets
9
Q
intersection_update()
A
updates calling set with intersection of sets
10
Q
isdisjoint()
A
checks disjoint sets
11
Q
issubset()
A
checks if a set is subset of another set
12
Q
pop()
A
remives an arbitrary element
13
Q
symmetric_difference()
A
returns symmetric difference
14
Q
symmetric_difference_update()
A
updates set with symmetric difference
15
Q
union()
A
returns union of sets