diff options
author | Hui Lan <lanhui@zjnu.edu.cn> | 2019-07-30 13:35:11 +0800 |
---|---|---|
committer | Hui Lan <lanhui@zjnu.edu.cn> | 2019-07-30 13:35:11 +0800 |
commit | 15b98756f60765dae408760a1620e47d9531295c (patch) | |
tree | 89804f62324cd7333b80a52144addea309a1ce33 /LectureNotesOnPython.rst | |
parent | dd55397153720cb4db56920768c1bb02ecd85417 (diff) |
LectureNotesOnPython.rst: 添加列表容易出错的地方。 用list来做变量名。
Diffstat (limited to 'LectureNotesOnPython.rst')
-rw-r--r-- | LectureNotesOnPython.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/LectureNotesOnPython.rst b/LectureNotesOnPython.rst index 8065a8e..4f75b07 100644 --- a/LectureNotesOnPython.rst +++ b/LectureNotesOnPython.rst @@ -1108,6 +1108,8 @@ join方法 列表小技巧。 把列表中不同的元素提取出来, 做成另外一个列表。 list(set(lst)) 。 +容易出错的地方。 很多初学者会用list作为列表数据的变量名。 不要这么做。 可以用 lst 或 L 来做变量名。 + **练习** 给定任何一个字符串, 统计其中各个单词出现的频率。 考虑以下几种情况。 |