QuestionQ2

Object-Oriented Programming

What is true about the bases attribute in Python?

  • A There is no such property.
  • B It is accessible inside an object.
  • C It is accessible inside a class and an object.
  • D It is accessible inside a class.
Explanation

The __bases__ attribute belongs to a class and contains a tuple of its direct base classes. It is accessed on the class itself, not on an instance.

Community Discussion

No comments yet. Be the first to start the discussion!