This project define a class called BankAccount, which simulates a simple bank account with basic functionalities. The class includes methods for depositing money, withdrawing money, checking the balance, and displaying account information.
There are 2 files in the project. The bankaccount.py defines the class and main.py instantiates 3 instances of the class and performs methods on each class.
No extra modules necessary
The BankAccount includes the following methods:
- deposit(amount): Adds the specified amount to the account balance.
- withdraw(amount): Deducts the specified amount from the account balance, if sufficient funds are available.
- get_balance(): Prints the current balance of the account.
- display_account_info(): Prints out the account number, account holder name, and current balance.
- Create an Account: Instantiate the BankAccount class with account number, account holder name, and the initial balance.
- Depositing Money: Use the 'deposit' method to add money to the account.
- Withdrawing Money: Use the 'withdraw' method to add money to the account.
- Checking the Balance: Use the 'get_balance' method to print the current balance.
- Displaying Account Information: Use the 'display_account_info' method to print out account details.