Answered step by step
Verified Expert Solution
Question
1 Approved Answer
from accounts import BankAccount def balances(): print(' #### Balances of All Accounts#### ') total = 0 for i in range(len(my_accounts)): print(Name: , my_accounts[i].name, tNumber: ,
from accounts import BankAccount def balances(): print(' #### Balances of All Accounts#### ') total = 0 for i in range(len(my_accounts)): print("Name: ", my_accounts[i].name, "\tNumber: ", my_accounts[i].num, \ "\tBalance: ", my_accounts[i].bal) total = total + my_accounts[i].bal print("\t\t\t\t\tTotal: ", total) print(' #### Bank Accounts #### ') my_accounts = [] # add code for tasks here balances()Modify testAccounts.py to: 1. Create an account "Savings", a/c number "100000-1", balance $1000 2. Create an account "Everyday", alc number "100000-2", balance $100 3. Add both accounts to the my_accounts list 4. Print the balances of the accounts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started