Path: blob/master/05-Object Oriented Programming/05-OOP Challenge - Solution.ipynb
666 views
Kernel: Python 3
Object Oriented Programming Challenge - Solution
For this challenge, create a bank account class that has two attributes:
owner
balance
and two methods:
deposit
withdraw
As an added requirement, withdrawals may not exceed the available balance.
Instantiate your class, make several deposits and withdrawals, and test to make sure the account can't be overdrawn.
In [1]:
In [2]:
In [3]:
Out[3]:
Account owner: Jose
Account balance: $100
In [4]:
Out[4]:
'Jose'
In [5]:
Out[5]:
100
In [6]:
Out[6]:
Deposit Accepted
In [7]:
Out[7]:
Withdrawal Accepted
In [8]:
Out[8]:
Funds Unavailable!