Location>code7788 >text

The Best Object-Oriented Programming Tutorials on the Web for Getting Started: 39 Python Common Composite Data Types - Collections

Popularity:570 ℃/2024-08-27 00:42:50
add() Adds elements to the collection.
clear() Removes all elements from the collection.
copy() Copy a collection.
difference() Returns the difference set of multiple sets.
difference_update() Removes an element from a collection that also exists in the specified collection.
discard() Deletes the specified element of the collection.
intersection() Returns the intersection of sets.
intersection_update() Returns the intersection of sets.
isdisjoint() Determines whether two collections contain the same element, if not returns True, otherwise returns False.
issubset() Determines whether the specified collection is a subset of the method's argument collection.
issuperset() Determines whether the method's set of arguments is a subset of the specified set.
pop() Randomly removes elements.
remove() Removes the specified element.
symmetric_difference() Returns the set of elements that are not duplicated in the two collections.
symmetric_difference_update() Removes an element from the current collection that is the same in another specified collection and inserts a different element from another specified collection into the current collection.
union() Returns the union of two sets.
update() Adds elements to the collection.
len() Calculate the number of set elements.