python中集合的符号_Python:集合与字符串格式化

1 classset(object):2 """

3 set() -> new empty set object4 set(iterable) -> new set object5

6 Build an unordered collection of unique elements.7 """

8 def add(self, *args, **kwargs): #real signature unknown

9 """增加元素,传一个参数"""

10 """

11 Add an element to a set.12

13 This has no effect if the element is already present.14 """

15 pass

16

17 def clear(self, *args, **kwargs): #real signature unknown

18 """清除集合内的所有元素"""

19 """Remove all elements from this set."""

20 pass

21

22 def copy(self, *args, **kwargs): #real signature unknown

23 """浅拷贝集合内的元素"""

24 """Return a shallow copy of a set."""

25 pass

26

27 def difference(self, *args, **kwargs): #real signature unknown

28 """求差集 相当于集合return a-b"""

29 """

30 Return the difference of two or more sets as a new set.31

32 (i.e. all elements that are in this set but not the others.)33 """

34 pass

35

36 def difference_update(self, *args, **kwargs): #real signature unknown

37 """a.difference_update(b) 相当于 a = a - b"""

38 """Remove all elements of another set from this set."""

39 pass

40

41 def discard(self, *args, **kwargs): #real signature unknown

42 """删除一个元素,元素不存在时不会报错"""

43 """

44 Remove an element from a set if it is a member.45

46 If the element is not a member, do nothing.47 """

48 pass

49

50 def intersection(self, *args, **kwargs): #real signature unknown

51 """求两个集合的交集;相当于 return a & b"""

52 """

53 Return the intersection of two sets as a new set.54

55 (i.e. all elements that are in both sets.)56 """

57 pass

58

59 def intersection_update(self, *args, **kwargs): #real signature unknown

60 """求两个集合的交集 更新;相当于 a = a & b"""

61 """Update a set with the intersection of itself and another."""

62 pass

63

64 def isdisjoint(self, *args, **kwargs): #real signature unknown

65 """如果两个集合的交集为空,返回true"""

66 """Return True if two sets have a null intersection."""

67 pass

68

69 def issubset(self, *args, **kwargs): #real signature unknown

70 """a.issubset(b) a是否是b的子集 相当于 a <= b"""

71 """Report whether another set contains this set."""

72 pass

73

74 def issuperset(self, *args, **kwargs): #real signature unknown

75 """a.issubset(b) a是否是b的父集 相当于 a > b"""

76 """Report whether this set contains another set."""

77 pass

78

79 def pop(self, *args, **kwargs): #real signature unknown

80 """随机删除一个元素"""

81 """

82 Remove and return an arbitrary set element.83 Raises KeyError if the set is empty.84 """

85 pass

86

87 def remove(self, *args, **kwargs): #real signature unknown

88 """指定一个元素删除,只能有一个元素;删除元素不存在会报错"""

89 """

90 Remove an element from a set; it must be a member.91

92 If the element is not a member, raise a KeyError.93 """

94 pass

95

96 def symmetric_difference(self, *args, **kwargs): #real signature unknown

97 """交叉差集; 两个集合;相当于先并集再去除他们相同的元素; a ^ b"""

98 """

99 Return the symmetric difference of two sets as a new set.100

101 (i.e. all elements that are in exactly one of the sets.)102 """

103 pass

104

105 def symmetric_difference_update(self, *args, **kwargs): #real signature unknown

106 """交叉差集更新; 两个集合;相当于先并集再去除他们相同的元素;a = a ^ b"""

107 """Update a set with the symmetric difference of itself and another."""

108 pass

109

110 def union(self, *args, **kwargs): #real signature unknown

111 """求并集 相当于 return a | b"""

112 """

113 Return the union of sets as a new set.114

115 (i.e. all elements that are in either set.)116 """

117 pass

118

119 def update(self, *args, **kwargs): #real signature unknown

120 """更新 元素,可以更新多个值,但是'int' object is not iterable;相当于 a = a | b"""

121 """Update a set with the union of itself and others."""

122 pass

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值