What is the default accessibility of attributes in a Python class?

Options

  • A. Private
  • B. Protected
  • C. Public
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. Public

Detailed Explanation

Python class attributes are public by default. A leading underscore indicates non-public usage by convention, while double leading underscores trigger name mangling.