Skip to content

Commit 5eefad4

Browse files
committed
py
1 parent aaed9d3 commit 5eefad4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python_base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@
8888
t.add('x'); t.remove('H') # 增加/删除一个item
8989
s.update([10,37,42]) # 利用[......]更新s集合
9090
x in s, x not in s # 集合中是否存在某个值
91-
s.issubset(t); s.issuperset(t); s.copy(); s.discard(x); s.clear()
91+
s.issubset(t); s <= t # 测试是否 s 中的每一个元素都在 t 中
92+
s.issuperset(t); s >= t # 测试是否 t 中的每一个元素都在 s 中
93+
s.copy();
94+
s.discard(x); # 删除s中x
95+
s.clear() # 清空s
9296
{x**2 for x in [1, 2, 3, 4]} # 集合解析,结果:{16, 1, 4, 9}
9397
{x for x in 'spam'} # 集合解析,结果:{'a', 'p', 's', 'm'}
9498

0 commit comments

Comments
 (0)