1. Home
  2. Data Science
  3. Python
  4. What does a method decorated with @classmethod receive as…

Added 2 Nov 2026

What does a method decorated with @classmethod receive as its first argument?

  1. No automatic argument
  2. The class itself (cls) Correct answer
  3. The parent module
  4. The instance (self)

Correct answer

B. The class itself (cls)

19 views

MCQSEXAM

Explanation

Class methods are often used as alternative constructors, such as Date.from_string(). Static methods receive no automatic first argument.

Reference

Asked in: NTS, Python Developer Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs