Skip to content

Commit 448a890

Browse files
committed
修复 set 交集方法
1 parent 2526f07 commit 448a890

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

docs/09_集合/set_adt.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ def __and__(self, other_set):
150150
for element_a in self:
151151
if element_a in other_set:
152152
new_set.add(element_a)
153-
for element_b in other_set:
154-
if element_b in self:
155-
new_set.add(element_b)
156153
return new_set
157154

158155
def __sub__(self, other_set):

0 commit comments

Comments
 (0)