I. Object-oriented
1. Object-oriented and process-oriented comparisons
The process of focusing on the problem-solving procedure is a mechanical way of thinking, which is realized by pipelining.
Object-oriented objects are a combination of features and skills, and object-oriented is a simulation of the real world, like
God creates the world.
Process-oriented advantages can be complex problems of the process, simplification, the advantages of object-oriented is strong scalability.
2. Classes and objects
Class and object relationships: A class is a combination of a series of object-similar features and skills.
The real world: existing specific objects---------------"Summary of similarities------------" formation of the class
Program: Define class--------------call class to produce object
Example:
Note: 1. Classes and functions are different, classes are executed during the definition phase, and namespaces are generated and viewed with _dict_
2. Class name parentheses, which produce an object of a class, is called instantiation
3. Inheritance of Classes
4. Characteristics of Inheritance:
1. Resolves a problem where class and class code are duplicated.
2. Derive the new attribute in the subclass, whichever is your own.
3. Reuse the functionality of the parent class within a new method derived from the subclass: Call People._init_ directly
Python path-Object oriented