A

Admin • 833K Points
Coach

Q. How do you create a class attribute in Python?

  • (A) Inside `__init__` using `self`
  • (B) Using `global` keyword
  • (C) Outside any method inside class
  • (D) Using `static` keyword
  • Correct Answer - Option(C)
  • Views: 21
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

Class attributes are defined directly within the class, but outside of any methods.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.