static methods and class methods in class definitionall functions are assumed to operate on an instancewhich is always passed as the first parameter self howeverthere are two other common kinds of methods that can be defined static method is an ordinary function that just happens to live in the namespace defined by class it does not operate on any kind of instance to define static methoduse the @staticmethod decorator as shown hereclass foo(object)@staticmethod def add( , )return to call static methodyou just prefix it by the class name you do not pass it any additional information for examplex foo add( , common use of static methods is in writing classes where you might have many different ways to create new instances because there can only be one _init_ (functionalternative creation functions are often defined as shown hereclass date(object)def _init_ (self,year,month,day)self year year self month month self day day @staticmethod def now() time localtime(return date( tm_yeart tm_mont tm_day@staticmethod def tomorrow() time localtime(time time()+ return date( tm_yeart tm_mont tm_dayexample of creating some dates date( date now(calls static method now( date tomorrow(calls static method tomorrow(class methods are methods that operate on the class itself as an object defined using the @classmethod decoratora class method is different than an instance method in that the class is passed as the first argument which is named cls by convention for exampleclass times(object)factor @classmethod def mul(cls, )return cls factor* class twotimes(times)factor twotimes mul( calls times mul(twotimes - lib fl ff