Skip to content

Commit 204cae3

Browse files
committed
修正了第14课文档中的bug
1 parent d4ed9c7 commit 204cae3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

第014课:常用数据结构之集合.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ set1.clear()
159159
print(set1) # set()
160160
```
161161

162-
如果要判断两个集合有没有相同的元素可以使用`isdisjoint`方法,代码如下所示。
162+
如果要判断两个集合有没有相同的元素可以使用`isdisjoint`方法,没有相同元素返回`True`,否则返回`False`代码如下所示。
163163

164164
```Python
165165
set1 = {'Java', 'Python', 'Go', 'Kotlin'}
166166
set2 = {'Kotlin', 'Swift', 'Java', 'Objective-C', 'Dart'}
167167
set3 = {'HTML', 'CSS', 'JavaScript'}
168-
print(set1.isdisjoint(set2)) # True
169-
print(set1.isdisjoint(set3)) # False
168+
print(set1.isdisjoint(set2)) # False
169+
print(set1.isdisjoint(set3)) # True
170170
```
171171

172172
### 不可变集合

0 commit comments

Comments
 (0)