summaryrefslogtreecommitdiff
path: root/LectureNotesOnPython.rst
diff options
context:
space:
mode:
authorHui Lan <lanhui@zjnu.edu.cn>2019-03-31 17:03:46 +0800
committerHui Lan <lanhui@zjnu.edu.cn>2019-03-31 17:03:46 +0800
commitcc6155985ba7971224d0109d2c1d1501208b5ff9 (patch)
tree838a5d5093d3f82eeb71ba9431ac251670aa7ec1 /LectureNotesOnPython.rst
parent7005f55b94989bdbdb976b1721ea6e9d7ff87d48 (diff)
updated lecture notes
Diffstat (limited to 'LectureNotesOnPython.rst')
-rw-r--r--LectureNotesOnPython.rst27
1 files changed, 21 insertions, 6 deletions
diff --git a/LectureNotesOnPython.rst b/LectureNotesOnPython.rst
index b47b929..8505e95 100644
--- a/LectureNotesOnPython.rst
+++ b/LectureNotesOnPython.rst
@@ -10,6 +10,7 @@ Lecture Notes on Python
非学究写书,无空洞行文。Python语法简洁,库函数全面强大,编程速度快,运行速度也不慢。
+.. contents:: 内容目录
Python的发音纠正
@@ -259,8 +260,8 @@ a = [1, 2] 可以原地修改a[0] = 2
-数
-------
+数与格式化显示
+-------------------------
| x = 3.1415926
@@ -641,11 +642,18 @@ error-prone(易错)
return t[1:]
-**TDD**
- Test-driven Development。测试驱动开发。 使用pytest。如何安装? 使用命令 ``pip install pytest``
+TDD - Test-driven Development
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+测试驱动开发。 My favourite。 刺激有挑战性。 帮助厘清需求。 帮助编写代码。
+
+推荐使用pytest。如何安装? 使用命令 ``pip install pytest``
+
-
+计算复杂度
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
用Big O表述复杂度。O(n), O(n^2), O(n^3)。
@@ -680,7 +688,14 @@ key-value pair (item)
item的顺序不可预测,不是按照创建时的顺序。
-练习:给定一个字符串,数出每个字母出现的频率。使用 **Incremental Development** 。
+
+递增开发(Incremental Development)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+每次完成一小点。从易到难。
+
+
+练习:给定一个字符串,数出每个字母出现的频率。
| def histogram(s):
| ''' Cannot pass any test cases. '''