freeCodeCamp/guide/chinese/python/object-oriented-programming/index.md

16 lines
685 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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