Question: The _ _ str _ _ method of the Bank class ( in bank.py ) returns a string containing the accounts in random order. Design
The str method of the Bank class in bank.py returns a string containing the accounts in random order. Design and implement a change that causes the accounts to be placed in the string in ascending order of name.
Implement the str method of the bank class so that it sorts the account values before printing them to the console.
In order to sort the account values you will need to define the eq and lt methods in the SavingsAccount class in savingsaccount.py
The eq method should return True if the account names are equal during a comparison, False otherwise.
The lt method should return True if the name of one account is less than the name of another, False otherwise.
The program should output in the following format:
Test for createBank:
Name: Jack
PIN:
Balance:
Name: Mark
PIN:
Balance:
Name: Name
PIN:
Balance:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
