In a banking application, you have an Account class. If you want to set a minimum balance for all accounts regardless of their type, where would you define this value?

  • As a class attribute
  • In a separate module
  • In a subclass
  • In the constructor (__init__)
To set a minimum balance for all accounts regardless of their type, you should define this value as a class attribute. Class attributes are shared among all instances of the class, ensuring that the minimum balance is consistent for all accounts.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *