Where is the position of self?
First, self is in the method of the class, and when this method is called, it is not assigned a value, and Python automatically assigns it to it, and this value is the instance of the class-the object itself. You can also change self to other names such as Seef, but not recommended, because it is customary to write self as a default.
When writing code, the class's method system directly has self, as follows:
Second, self is the default first parameter of the class method and is required, without writing an error.
Second, what is the value of self?
The value of self is automatically assigned by Python, and the value is the object itself. For example: Class Dog, whose instance is D, then, when D calls the method Jian (arge1,arge2) of the class, Python automatically transitions to Dog.jian (d,arge1,arge2). The value of Self is instance D of dog.
The following example prints the value of self. (The intance in the printed result is the meaning of the instance)
The understanding of the self of Python