Files
freeCodeCamp/guide/chinese/python/object-oriented-programming/classes/index.md
2018-10-16 21:32:40 +05:30

17 lines
558 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Classes
localeTitle: 类
---
## 类
类是创建对象的“蓝图”:编写类允许描述属性和行为公共到该类的每个实例。
## 创建一个类
要定义类,请使用关键字**类** ,后跟定义类的名称和冒号。以下所有行(描述属性和行为/方法的代码) - 在Python函数中缩进。例如要创建一个名为Person的类我们可以编写
`class Person: <code describing attributes and behaviors/methods>`
类定义必须在它们产生任何影响之前执行。
#### 更多信息: