Академический Документы
Профессиональный Документы
Культура Документы
owner
balance
deposit
withdraw
Instantiate your class, make several deposits and withdrawals, and test to make sure the account
can't be overdrawn.
def __str__(self):
return f'Account owner: {self.owner}\nAccount balance:
${self.balance}'
def deposit(self,dep_amt):
self.balance += dep_amt
print('Deposit Accepted')
def withdraw(self,wd_amt):
if self.balance >= wd_amt:
self.balance -= wd_amt
print('Withdrawal Accepted')
else:
print('Funds Unavailable!')
https://render.githubusercontent.com/view/ipynb?commit=c2407e5f…epository_type=Repository#7b0f8da0-a670-4cd5-a292-25069468665f Page 1 of 2
Render 01/11/19, 8(56 AM
Out[4]: 'Jose'
Out[5]: 100
Deposit Accepted
In [7]: acct1.withdraw(75)
Withdrawal Accepted
Funds Unavailable!
Good job!
https://render.githubusercontent.com/view/ipynb?commit=c2407e5f…epository_type=Repository#7b0f8da0-a670-4cd5-a292-25069468665f Page 2 of 2