Question: def getNumAccounts ( self ) : ' ' ' getNumAccounts - returns the number of accounts in the portfolio enter your code below ' '

def getNumAccounts(self):
'''
getNumAccounts - returns the number of accounts in the portfolio
enter your code below
'''
return len(self.accounts)
def getTotalBalance(self):
''1
getNumAccounts - returns the number of accounts in the poartfolio
enter your code below - the balances code may help
'''
total_balance =0
for account in self.accounts:
total_balance += account.getBalance()
return total_balance
what does this code do
def getNumAccounts ( self ) : ' ' '

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!