Bird
0
0

Which of the following is a correct way to call a class method named create from a class Car?

easy📝 Conceptual Q2 of 15
Python - Class Methods and Static Methods
Which of the following is a correct way to call a class method named create from a class Car?
Aself.create()
BCar.create()
Ccreate(Car)
DCar.create(self)
Step-by-Step Solution
Solution:
  1. Step 1: Recall class method calling

    Class methods can be called directly on the class without creating an instance.
  2. Step 2: Evaluate options

    Car.create() calls the method on the class correctly. self.create() is invalid because self is not defined. Options C and D are invalid syntax.
  3. Final Answer:

    Car.create() -> Option B
  4. Quick Check:

    Call class method on class = Car.create() [OK]
Quick Trick: Call class methods on the class, not instance [OK]
Common Mistakes:
  • Calling class methods with self argument
  • Trying to call class methods without class prefix
  • Confusing instance and class method calls

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes