From 9b40774bd059f218bfe877142bdd2851b360ebe8 Mon Sep 17 00:00:00 2001 From: LSGOMYP Date: Wed, 22 Jul 2020 17:07:44 +0800 Subject: [PATCH] =?UTF-8?q?Update=2009.=20=E5=AD=97=E5=85=B8.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Python-Language/09. 字典.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python-Language/09. 字典.md b/Python-Language/09. 字典.md index b6b3aa0..7ca1711 100644 --- a/Python-Language/09. 字典.md +++ b/Python-Language/09. 字典.md @@ -288,7 +288,7 @@ print(dic1) # {2: [1, 2]} ```python dic = {'Name': 'Zara', 'Age': 7} print("字典长度 : %d" % len(dic)) # 字典长度 : 2 -dict.clear() +dic.clear() print("字典删除后长度 : %d" % len(dic)) # 字典删除后长度 : 0 ``` @@ -300,7 +300,7 @@ print("字典删除后长度 : %d" % len(dic)) ```python dic1 = {'Name': 'Lsgogroup', 'Age': 7, 'Class': 'First'} dic2 = dic1.copy() -print("dic2) +print("dic2") # {'Age': 7, 'Name': 'Lsgogroup', 'Class': 'First'} ``` 【例子】直接赋值和 copy 的区别