Lab Exercise 7.1
Create a class called “BankAccount” that models a user’s bank account. The class should have the following attributes:
- Account number (a unique identifier)
- Account holder’s name
- Account balance
The class should have the following methods:
- init(self, account_number, account_holder, initial_balance) This method is the constructor that initializes the account attributes. It takes the account number, account holder’s name, and initial balance as parameters.
- deposit(self, amount) This method should add the given amount to the account balance.
- withdraw(self, amount) This method should subtract the given amount from the account balance. However, it should check if the account has sufficient balance before allowing the withdrawal. ...