python學習(九)常用數據類型之set

類名:set

複製代碼

  1 def add(self, *args, **kwargs):  # real signature unknown
  2         """ 向集合中添加元素,如果該元素已存在則不添加 """
  3         """
  4         Add an element to a set.
  5 
  6         This has no effect if the element is already present.
  7         """
  8         pass
  9 
 10     def clear(self, *args, **kwargs):  # real signature unknown
 11         """ 清空集合 """
 12         """ Remove all elements from this set. """
 13         pass
 14 
 15     def copy(self, *args, **kwargs):  # real signature unknown
 16         """ 淺拷貝 """
 17         """ Return a shallow copy of a set. """
 18         pass
 19 
 20     def difference(self, *args, **kwargs):  # real signature unknown
 21         """ 返回A中存在B中不存在的元素 """
 22         """
 23         Return the difference of two or more sets as a new set.
 24 
 25         (i.e. all elements that are in this set but not the others.)
 26         """
 27         pass
 28 
 29     def difference_update(self, *args, **kwargs):  # real signature unknown
 30         """ 返回A中存在B中不存在的元素並將其更新給A """
 31         """ Remove all elements of another set from this set. """
 32         pass
 33 
 34     def discard(self, *args, **kwargs):  # real signature unknown
 35         """ 移除指定元素,不存在不報錯 """
 36         """
 37         Remove an element from a set if it is a member.
 38 
 39         If the element is not a member, do nothing.
 40         """
 41         pass
 42 
 43     def intersection(self, *args, **kwargs):  # real signature unknown
 44         """ 交集 """
 45         """
 46         Return the intersection of two sets as a new set.
 47 
 48         (i.e. all elements that are in both sets.)
 49         """
 50         pass
 51 
 52     def intersection_update(self, *args, **kwargs):  # real signature unknown
 53         """ 取交集並更新到A """
 54         """ Update a set with the intersection of itself and another. """
 55         pass
 56 
 57     def isdisjoint(self, *args, **kwargs):  # real signature unknown
 58         """ 如果沒有交集返回True,否則返回False """
 59         """ Return True if two sets have a null intersection. """
 60         pass
 61 
 62     def issubset(self, *args, **kwargs):  # real signature unknown
 63         """ 如果A是B的子集,返回True,否則返回False """
 64         """ Report whether another set contains this set. """
 65         pass
 66 
 67     def issuperset(self, *args, **kwargs):  # real signature unknown
 68         """ 如果A是B的父集,返回True,否則返回False """
 69         """ Report whether this set contains another set. """
 70         pass
 71 
 72     def pop(self, *args, **kwargs):  # real signature unknown
 73         """ 隨機刪除集合中的元素 """
 74         """
 75         Remove and return an arbitrary set element.
 76         Raises KeyError if the set is empty.
 77         """
 78         pass
 79 
 80     def remove(self, *args, **kwargs):  # real signature unknown
 81         """ 移除集合中的指定元素 """
 82         """
 83         Remove an element from a set; it must be a member.
 84 
 85         If the element is not a member, raise a KeyError.
 86         """
 87         pass
 88 
 89     def symmetric_difference(self, *args, **kwargs):  # real signature unknown
 90         """ 對稱差集 """
 91         """
 92         Return the symmetric difference of two sets as a new set.
 93 
 94         (i.e. all elements that are in exactly one of the sets.)
 95         """
 96         pass
 97 
 98     def symmetric_difference_update(self, *args, **kwargs):  # real signature unknown
 99         """ 取對稱差集並更新到A """
100         """ Update a set with the symmetric difference of itself and another. """
101         pass
102 
103     def union(self, *args, **kwargs):  # real signature unknown
104         """ 並集 """
105         """
106         Return the union of sets as a new set.
107 
108         (i.e. all elements that are in either set.)
109         """
110         pass
111 
112     def update(self, *args, **kwargs):  # real signature unknown
113         """ 更新 """
114         """ Update a set with the union of itself and others. """
115         pass
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章