Examveda

What is the role of the @staticmethod decorator in Python?

A. To define static variables

B. To make a method callable without an instance

C. To add static typing to variables

D. To prevent method overriding

Answer: Option B

Solution (By Examveda Team)

The @staticmethod decorator allows a method to be called without creating an instance of the class.

This Question Belongs to Python Program >> Decorators In Depth

Join The Discussion

Related Questions on Decorators in Depth