16 lines
685 B
Markdown
16 lines
685 B
Markdown
---
|
||
title: Python Object Oriented Programming
|
||
localeTitle: 面向对象的Python编程
|
||
---
|
||
## 面向对象的Python编程
|
||
|
||
Python是一种支持不同编程方法的多范式编程语言。一种优秀的编程范例是面向对象编程,或简称OOP,通过创建对象。
|
||
|
||
在OOP中,属性和行为被捆绑到单个对象中,其特征如下:
|
||
|
||
* 属性
|
||
* 行为
|
||
|
||
例如,一个对象可以代表具有属性的人,如姓名,年龄,地址,行走,说话,呼吸和跑步等行为。
|
||
|
||
OOP将现实世界的实体建模为软件对象,它们具有与之相关的一些数据并且可以执行某些功能。对象被建模为**类** ,这是一种_蓝图_ 。 |