From 087b0fca63d4803a70ce6de8d1314669be4773fb Mon Sep 17 00:00:00 2001 From: Tqlsdlddw <51898470+Tqlsdlddw@users.noreply.github.com> Date: Sat, 3 Aug 2019 15:55:06 +0800 Subject: [PATCH 1/4] Update codeSpecification_first.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除2.5编码,与1编码重复 --- Article/codeSpecification/codeSpecification_first.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Article/codeSpecification/codeSpecification_first.md b/Article/codeSpecification/codeSpecification_first.md index 1c44091..5f3faa6 100644 --- a/Article/codeSpecification/codeSpecification_first.md +++ b/Article/codeSpecification/codeSpecification_first.md @@ -54,10 +54,6 @@ def main(): * 可以使用多个空行分隔多组相关的函数 * 函数中可以使用空行分隔出逻辑相关的代码 -### 2.5、编码 - -* 文件使用 UTF-8 编码 -* 文件头部加入`#-*-conding:utf-8-*-`标识 ## 3、import 语句 @@ -258,4 +254,4 @@ Optional plotz says to frobnicate the bizbaz first. """ """Oneline docstring""" -``` \ No newline at end of file +``` From 3834ef45902148226072a0132ecfd28043144485 Mon Sep 17 00:00:00 2001 From: LiuTingwei Date: Mon, 3 Feb 2020 00:49:44 +0800 Subject: [PATCH 2/4] =?UTF-8?q?list=E5=85=B3=E9=94=AE=E5=AD=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Article/PythonBasis/python7/3.md | 16 ++++++++-------- README.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Article/PythonBasis/python7/3.md b/Article/PythonBasis/python7/3.md index 77fb5db..177ba14 100644 --- a/Article/PythonBasis/python7/3.md +++ b/Article/PythonBasis/python7/3.md @@ -1,4 +1,4 @@ -# 三、lsit 生成式(列表生成式) # +# 三、list 生成式(列表生成式) # ## 1、创建 list 的方式 ## @@ -48,7 +48,7 @@ print('\n'.join([' '.join ('%dx%d=%2d' % (x,y,x*y) for x in range(1,y+1)) for y ## 2、list 生成式的创建 ## -首先,lsit 生成式的语法为: +首先,list 生成式的语法为: ```python [expr for iter_var in iterable] @@ -65,8 +65,8 @@ print('\n'.join([' '.join ('%dx%d=%2d' % (x,y,x*y) for x in range(1,y+1)) for y ```python # -*- coding: UTF-8 -*- -lsit1=[x * x for x in range(1, 11)] -print(lsit1) +list1=[x * x for x in range(1, 11)] +print(list1) ``` 输出的结果: @@ -79,8 +79,8 @@ print(lsit1) ```python # -*- coding: UTF-8 -*- -lsit1= [x * x for x in range(1, 11) if x % 2 == 0] -print(lsit1) +list1= [x * x for x in range(1, 11) if x % 2 == 0] +print(list1) ``` 输出的结果: @@ -95,8 +95,8 @@ print(lsit1) ```python # -*- coding: UTF-8 -*- -lsit1= [(x+1,y+1) for x in range(3) for y in range(5)] -print(lsit1) +list1= [(x+1,y+1) for x in range(3) for y in range(5)] +print(list1) ``` 输出的结果: diff --git a/README.md b/README.md index da008c9..a9df880 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ IT 行业相对于一般传统行业,发展更新速度更快,一旦停止 * [迭代器和生成器](/Article/PythonBasis/python7/Preface.md) - [迭代](/Article/PythonBasis/python7/1.md) - [Python 迭代器](/Article/PythonBasis/python7/2.md) - - [lsit 生成式(列表生成式)](/Article/PythonBasis/python7/3.md) + - [list 生成式(列表生成式)](/Article/PythonBasis/python7/3.md) - [生成器](/Article/PythonBasis/python7/4.md) - [迭代器和生成器综合例子](/Article/PythonBasis/python7/5.md) * [面向对象](/Article/PythonBasis/python8/Preface.md) From e35ed125a7539beda90a4e408856b6e140f7cfe6 Mon Sep 17 00:00:00 2001 From: IBen <34202602+IBen-dev@users.noreply.github.com> Date: Sun, 8 Mar 2020 18:33:01 +0800 Subject: [PATCH 3/4] Update 1.md --- Article/PythonBasis/python8/1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Article/PythonBasis/python8/1.md b/Article/PythonBasis/python8/1.md index 569b4ab..13fd9e0 100644 --- a/Article/PythonBasis/python8/1.md +++ b/Article/PythonBasis/python8/1.md @@ -16,7 +16,7 @@ Python 就是一门面向对象的语言, 如果你学过 Java ,就知道 Java 的编程思想就是:万事万物皆对象。Python 也不例外,在解决实际问题的过程中,可以把构成问题事务分解成各个对象。 -面向对象都有两个基本的概率,分别是类和对象。 +面向对象都有两个基本的概念,分别是类和对象。 * **类** From 83494283170bb26583504374c83ca7ef4279b42e Mon Sep 17 00:00:00 2001 From: IBen <34202602+IBen-dev@users.noreply.github.com> Date: Sun, 8 Mar 2020 20:43:09 +0800 Subject: [PATCH 4/4] Update 3.md --- Article/PythonBasis/python8/3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Article/PythonBasis/python8/3.md b/Article/PythonBasis/python8/3.md index 358f0be..8214794 100644 --- a/Article/PythonBasis/python8/3.md +++ b/Article/PythonBasis/python8/3.md @@ -29,12 +29,12 @@ class 就是类,method 就是方法。 因此类方法,想要调用类属性,需要以下步骤: -* 在方法上面,用 `@classmethon` 声明该方法是类方法。只有声明了是类方法,才能使用类属性 +* 在方法上面,用 `@classmethod` 声明该方法是类方法。只有声明了是类方法,才能使用类属性 * 类方法想要使用类属性,在第一个参数中,需要写上 `cls` , cls 是 class 的缩写,其实意思就是把这个类作为参数,传给自己,这样就可以使用类属性了。 * 类属性的使用方式就是 `cls.变量名` -记住喔,无论是 `@classmethon` 还是 `cls` ,都是不能省去的。 +记住喔,无论是 `@classmethod` 还是 `cls` ,都是不能省去的。 省了都会报错。