Home > other >  Help you a great god a question about python classes
Help you a great god a question about python classes

Time:09-30


I want to ask you, why did you cross the red line there must enter a name for this class to normal operation of the "class"?
Front at the time of definition myproject function that set by the "self" is what mean? I said see knowledge is reference object itself, that why I want to use this class behind this method even when the parameter input "myclass" there

CodePudding user response:

Class can't call, you must first declare an instance of a class (object), then class definition of a function called
 
M=myclass ()
M.p ubilish ()

CodePudding user response:

refer to the second floor max5173 response:
class can't call, you must first declare an instance of a class (object), then class definition of a function called
 
M=myclass ()
M.p ubilish ()


Thank you for your reply!!
  • Related