Set Method
|
Description
|
add()
|
Adds an element to the specified set.
set_var.add(var)
|
clear()
|
Removes all elements from the specified set.
set_var.clear()
|
copy()
|
Returns a copy of the specified set.
set_var.copy()
|
difference()
|
Returns a set containing the difference between two or more specified sets.
set_var1.difference(set_var2)
|
difference_update()
|
Removes the items from one specified set that are also included in another specified set.
set_var1.difference_update(set_var2)
|
discard()
|
Removes the specified item from the specified set.
set_var.discard(value)
|
intersection()
|
Returns a set that is the intersection of two or more specified sets.
set_var1.intersection(set_var_2, set_var_3, ... set_var_n)
|
intersection_update()
|
Removes items from a specified set that are not in another specified set.
set_var.intersection_update(set_var_2, set_var_3, ... set_var_n)
|
isdisjoint()
|
Returns True or False whether two specified sets have an intersection or not.
set_var1.isdisjoint(set_var2)
|
issubset()
|
Returns True or False whether a specified set contains another specified set.
set_var1.issubset(set_var2)
|
issuperset()
|
Returns True or False whether a specified set contains another specified set.
set_var1.issuperset(set_var2)
|
pop()
|
Removes an element from the specified set.
set_var.pop()
|
remove()
|
Removes a specified element from a specified set.
set_var.remove(element)
|
symmetric_difference()
|
Returns a set of values that are the symmetric difference between two specified sets.
set_var1.symmetric_difference(set_var2)
|
symmetric_difference_update()
|
Inserts the symmetric differences from a specified set into another specified set.
set_var1.symmetric_difference_update(set_var2)
|
union()
|
Returns a set containing the union of one or more specified sets.
set_var1.union(set_var_2, set_var_3, ... set_var_n)
|
update()
|
Updates the specified set with another specified set, or any other specified iterable.
set_var1.update(set_var2)
|