Class and object relationships:
Class: is a model
Object: An entity created by a model that can be seen and touched.
The difference between classes and objects
It's just a concept, it's a class.
The description is very specific , that is the object
3 Elements of a class
Class name, property, method
Mouse
Properties: Can glow, color, price, logo
Method (behavior/function/operation): Some special function keys, left button, right button
Cell phone
Properties: Color, size, brand, battery capacity
Method: Listen to songs, call, send text messages, play games, take pictures
Air conditioning
Properties: Height, size, color, brand, power
Method: Left pendulum and pendulum, switch, hot/cool
Abstract of class
Describe the scene in real life in class
Definition of Class
1. Class name recommended way to use hump
2. When defining the method, you need to write the self
Object
1. How to create an Object cat () opens up a memory space in memory to generate a Cat object
2.cat = Cat () uses a variable to point to this memory space
3.self: Who calls, Self is who.
4. A method in a class must have a parameter that does not necessarily self, who invokes it, and passes it in as the first argument.
__init__ Method:
Python Object-oriented