Skip to content

Commit 979a6a5

Browse files
authored
Merge pull request walter201230#44 from IBen-dev/master
Update 1.md
2 parents 253d5e7 + 8349428 commit 979a6a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Article/PythonBasis/python8/1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Python 就是一门面向对象的语言,
1616

1717
如果你学过 Java ,就知道 Java 的编程思想就是:万事万物皆对象。Python 也不例外,在解决实际问题的过程中,可以把构成问题事务分解成各个对象。
1818

19-
面向对象都有两个基本的概率,分别是类和对象。
19+
面向对象都有两个基本的概念,分别是类和对象。
2020

2121
* ****
2222

Article/PythonBasis/python8/3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class 就是类,method 就是方法。
2929

3030
因此类方法,想要调用类属性,需要以下步骤:
3131

32-
* 在方法上面,用 `@classmethon` 声明该方法是类方法。只有声明了是类方法,才能使用类属性
32+
* 在方法上面,用 `@classmethod` 声明该方法是类方法。只有声明了是类方法,才能使用类属性
3333
* 类方法想要使用类属性,在第一个参数中,需要写上 `cls` , cls 是 class 的缩写,其实意思就是把这个类作为参数,传给自己,这样就可以使用类属性了。
3434
* 类属性的使用方式就是 `cls.变量名`
3535

3636

37-
记住喔,无论是 `@classmethon` 还是 `cls` ,都是不能省去的。
37+
记住喔,无论是 `@classmethod` 还是 `cls` ,都是不能省去的。
3838

3939
省了都会报错。
4040

0 commit comments

Comments
 (0)