Description: When an instance is created, the python automatically calls the __init__ method in the class to provide the attributes recessive for the instance
The __init__ method is called a constructor
If the __init__ method is not defined in the class, a simple namespace is only a simple namespace at the beginning of the instance creation
Class Myclass:
A = "Hello world"
Def __init__ (self, x)
Self.name=x
X =Myclass ("list")
Y = Myclass ("ABC") overloaded constructor
To Search:
File list (Check if you may need any files):
Filename | Size | Date |
---|
继承.pptx | 759565 | 2018-03-08 |