Set Methods

 0    18 flashcards    sir
tải về mp3 In chơi tự kiểm tra
 
câu hỏi câu trả lời
Returns a set, that is the intersection of two other sets.
bắt đầu học
. intersection() / &
Removes the items in this set that are not present in other, specified set(s).
bắt đầu học
. intersection_update() / &=
Returns a set containing the union of sets
bắt đầu học
. union() / |
Update the set with the union of this set and others
bắt đầu học
. update() / |=
Returns a set containing the difference between two or more sets.
bắt đầu học
. difference() / -
Removes the items in this set that are also included in another, specified set.
bắt đầu học
. difference_update() / -=
Returns a set with the symmetric differences of two sets
bắt đầu học
. symmetric_difference() / ^
Inserts the symmetric differences from this set and another
bắt đầu học
. symmetric_difference_update() / ^=
Returns a copy of the set.
bắt đầu học
. copy()
Removes all the elements from the set.
bắt đầu học
. clear()
Adds an element to the set.
bắt đầu học
. add()
Removes the specified element.
bắt đầu học
. remove()
Remove the specified item.
bắt đầu học
. discard()
Removes an element from the set
bắt đầu học
. pop()
Returns whether two sets have a intersection or not.
bắt đầu học
. isdisjoint()
Returns whether another set contains this set or not.
bắt đầu học
. issubset()
Returns whether this set contains another set or not.
bắt đầu học
. issuperset()
Returns the length of a set. (Inner method.)
bắt đầu học
. __len__

Bạn phải đăng nhập để đăng bình luận.