Python Set Methods Flashcards
Adds an element to the set
add()
Removes all the elements from the set
clear()
Returns a copy of the set
copy()
Returns a set containing the difference between two or more sets
difference()
Removes the items in this set that are also included in another, specified set
difference_update()
Remove the specified item
discard()
Returns a set, that is the intersection of two or more sets
intersection()
Removes the items in this set that are not present in other, specified set(s)
intersection_update()
Returns whether two sets have a intersection or not
isdisjoint()
Returns whether another set contains this set or not
issubset()
Returns whether this set contains another set or not
issuperset()
Removes an element from the set
pop()
Removes the specified element
remove()
Returns a set with the symmetric differences of two sets
symmetric_difference()
inserts the symmetric differences from this set and another
symmetric_difference_update()