Q. Which decorator is used to create a class method?

  • (A) @classmethod
  • (B) @staticmethod
  • (C) @property
  • (D) @class
πŸ’¬ Discuss
βœ… Correct Answer: (A) @classmethod
Explanation: The `@classmethod` decorator defines a method that takes `cls` as the first argument.
Explanation by: Mr. Dubey
The `@classmethod` decorator defines a method that takes `cls` as the first argument.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
99
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
81%
Success Rate