From 42c5580da727a5c29a77bffcc040db536a8d1b7f Mon Sep 17 00:00:00 2001 From: 1takes2 <31685687+ka1fe1@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:36:13 +0800 Subject: [PATCH 1/2] Update t2_process.py --- python/tutorial3_5/t2_process.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) From 8769f072d7c85f6c5e0b1ebc62246a955a2570d2 Mon Sep 17 00:00:00 2001 From: 1takes2 <31685687+ka1fe1@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:17:08 +0800 Subject: [PATCH 2/2] Update t3_dataStructure.py --- python/tutorial3_5/t3_dataStructure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)