From 520be4fe4cd388fc772f9da9f6057e9997c1aa39 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Mon, 1 Apr 2019 21:01:18 +0800 Subject: updated lecture notes --- LectureNotesOnPython.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'LectureNotesOnPython.html') diff --git a/LectureNotesOnPython.html b/LectureNotesOnPython.html index 4333633..eb0b066 100644 --- a/LectureNotesOnPython.html +++ b/LectureNotesOnPython.html @@ -815,7 +815,7 @@ A list of objects

'a' in 'banana' 'seed' in 'banana'

练习:写出下面的函数,使得 -in_both('apples', 'oranges')返回'aes'

+in_both('apples', 'oranges')返回'aes'。

字符串比较

@@ -1170,6 +1170,7 @@ error-prone(易错)

for x in lst: print('%s (%d)' % (x[0], x[1])) +

练习: 改写函数 word_frequency , 使它能接受第三个参数, black_lstblack_lst 是包含要排除考虑的单词的列表。 例如, black_lst 可以是 ['the', 'and', 'of', 'to']

key与value互换

-- cgit v1.2.1