diff --git a/python/tutorial3_5/t2_process.py b/python/tutorial3_5/t2_process.py index 66515cb..35f8658 100644 --- a/python/tutorial3_5/t2_process.py +++ b/python/tutorial3_5/t2_process.py @@ -26,7 +26,7 @@ print(words) # ['defenestrate', 'cat', 'window', 'defenestrate'] # range() 生成等差级数链表 -print(list(range(1, 10, 2))) # ['defenestrate', 'cat', 'window', 'defenestrate'] +print(list(range(1, 10, 2))) # [1, 3, 5, 7, 9] # break:与 c 语言类似,用于跳出最近一级循环 # continue:循环继续执行下一次迭代 @@ -183,4 +183,4 @@ def make_incrementor(n): f = make_incrementor(42) print(f(0)) -print(f(1)) \ No newline at end of file +print(f(1)) diff --git a/python/tutorial3_5/t3_dataStructure.py b/python/tutorial3_5/t3_dataStructure.py index 7f754f9..86e09d0 100644 --- a/python/tutorial3_5/t3_dataStructure.py +++ b/python/tutorial3_5/t3_dataStructure.py @@ -150,7 +150,7 @@ # dict()构造函数可以直接从 key-value 对中创建字典 -print(dict([('tom', 'men'), ('hanMeiMei', 'women')])) # display:{'liLei': 'man', 'hanMeiMei': 'women'}。从元组中创建字典 +print(dict([('tom', 'men'), ('hanMeiMei', 'women')])) # display:{'tom': 'man', 'hanMeiMei': 'women'}。从元组中创建字典 print(dict(tom='men', hanMeiMei='women', jack='undefined')) # {'jack': 'undefined', 'hanMeiMei': 'women', 'tom': 'men'} l1 = range(10)