Set PYTHON PDF
Set PYTHON PDF
A set is a collection which is unordered and unindexed. In Python sets are written
with curly brackets.
You cannot access items in a set by referring to an index, since sets are unordered
the items has no index.
Once a set is created, you cannot change its items, but you can add new items.
Method Description
intersection_update() Updates the set with the intersection of itself and another
symmetric_difference_update() Updates a set with the symmetric difference of itself and another
update() Updates the set with the union of itself and others
Function Description
all() Return True if all elements of the set are true (or if the set is empty).
any() Return True if any element of the set is true. If the set is empty, return False.
Return an enumerate object. It contains the index and value of all the items
enumerate() of set as a pair.
Return a new sorted list from elements in the set (does not sort the set
sorted() itself).