Skip to content

Commit

Permalink
修正了第14课文档中的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrued committed Jun 14, 2020
1 parent d4ed9c7 commit 204cae3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 第014课:常用数据结构之集合.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ set1.clear()
print(set1) # set()
```

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

```Python
set1 = {'Java', 'Python', 'Go', 'Kotlin'}
set2 = {'Kotlin', 'Swift', 'Java', 'Objective-C', 'Dart'}
set3 = {'HTML', 'CSS', 'JavaScript'}
print(set1.isdisjoint(set2)) # True
print(set1.isdisjoint(set3)) # False
print(set1.isdisjoint(set2)) # False
print(set1.isdisjoint(set3)) # True
```

### 不可变集合
Expand Down

0 comments on commit 204cae3

Please sign in to comment.