Set Methods

 0    18 词汇卡    sir
下载mp3 打印 检查自己
 
问题 答案
Returns a set, that is the intersection of two other sets.
开始学习
. intersection() / &
Removes the items in this set that are not present in other, specified set(s).
开始学习
. intersection_update() / &=
Returns a set containing the union of sets
开始学习
. union() / |
Update the set with the union of this set and others
开始学习
. update() / |=
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() / -=
Returns a set with the symmetric differences of two sets
开始学习
. symmetric_difference() / ^
Inserts the symmetric differences from this set and another
开始学习
. symmetric_difference_update() / ^=
Returns a copy of the set.
开始学习
. copy()
Removes all the elements from the set.
开始学习
. clear()
Adds an element to the set.
开始学习
. add()
Removes the specified element.
开始学习
. remove()
Remove the specified item.
开始学习
. discard()
Removes an element from the set
开始学习
. pop()
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()
Returns the length of a set. (Inner method.)
开始学习
. __len__

您必须登录才能发表评论。