It doesn't matter for this particular kata, but static methods don't have a self arg in the sense that other class methods have a self arg that refers to the instance of the class. What you'll actually get in self here is the first passed-in argument, which could be anything.
it is solution from chat gpt
woooow)
yes i did that ^^
You cam make a method static by the @staticmethod decorator.
Very Clear
Really great and easy solution! I'm really disappointed that I can't say that this is and clever and pest practice one time!
The reason a static method is a static method is because it doesn't require self or cls.
_
is often used as a variable that's unused (Other than in Lodash), it's just a variable name that doesn't really have a name.Hiii...
What is the use of
_
in(_,i)
? Please explain.It doesn't matter for this particular kata, but static methods don't have a
self
arg in the sense that other class methods have aself
arg that refers to the instance of the class. What you'll actually get inself
here is the first passed-in argument, which could be anything.