Home / Expert Answers / Computer Science / given-the-class-account-complete-the-function-main2-account-that-takes-a-list-of-account-objects-as-pa626

(Solved): Given the class Account, complete the function main2_account that takes a list of Account objects as ...



Given the class Account, complete the function main2_account that takes a list of Account objects as a parameter, and prints out the account number and account holder's name of each 'saving' account with a positive balance, as shown below.class Account:
Class representing a bank account.
def __init_(self, num, name, holder, balance):
self.num = num \# accounGiven the class Account, complete the function that takes a list of objects as a parameter, and prints out the account number

class Account: "'Class representing a bank account'.' def __init_(self, num, name, holder, balance): self.num = num \# account number self.name = name \# account name e.g. 'saving', 'credit' etc. self.holder holder \# name of the account holder self.balance balance \# initial balance def __str__(self): desc = self.name account, number self.num) return desc def deposit(self, amount): self.balance amount def is_positive_balance(self): return self.balance Given the class Account, complete the function that takes a list of objects as a parameter, and prints out the account number and account holder's name of each 'saving' account with a positive balance, as shown below. Example usage: acc Account , "saving', "Cleo", -12.70), Account(315917, 'saving', 'Jo', 10210.40), Account(419918, "investment', 'Amy', 1500.80), Account(518910, "credit', "Jessica', 3000.35), Account(212912, 'saving', 'Patrick', 10100.00) Account(617915, 'investment', 'Damian', 1810.70), Account (418912, "credit', 'Stanley', 4500.65) Account(515913, "credit', "Omar", 6000.25), Account(218919, 'saving', 'Nat', 1900.45), Account(810911," 'credit', "Andrew', 3200.86)] main2_account(acc) output: 315917 Jo 212912 Patrick 218919 Nat


We have an Answer from Expert

View Expert Answer

Expert Answer



Here's the implementation of the main2_account function that takes a list of Account objects as a parameter and prints out the account number and account holder's name of each 'saving' account with a positive balance:
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe