The ____ decorator is used to convert a function into a static method.

  • @classmethod
  • @classmethod
  • @staticmethod
  • @staticmethod()
In Python, the @staticmethod decorator is used to define a static method within a class. Static methods are methods that belong to a class rather than an instance and can be called on the class itself. They don't have access to the instance's state.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *