There is no class that accepts parameter, class has no parameters. There is an object constructor of a class called init()
which accepts to receive an argument because it is declared that this method has a parameter. When building the object you call by class name to indicate which init()
must be called, but it is not the class that accepts argument, let alone parameter.
The method metade()
has not declared any parameter to receive beyond the object itself through the self
, then the code cannot accept arguments, if you want it to accept, then you must declare it. But the internal code doesn’t make much sense because nothing is being necessary.
The self
is adopted to say that that parameter is the object itself, so the argument used will be written before the method, and so do the object-oriented syntax in which the main object is calling the function to be executed. At the bottom that’s an argument, but it doesn’t seem to be in the call syntax.
You only declare that there will be a parameter if it is necessary.
Useful: What is the difference between parameter and argument?.