Which decorator defines a method that belongs to the class rather than an instance and receives cls in Python?
Correct answer
A. @classmethod
7 views
A. @classmethod
7 views
@classmethod passes the class itself as the first argument.
Asked in: Python Interview OOP
https://docs.python.org/3/tutorial/classes.htmlNot sure why the answer is A? Ask here and get an explanation.