class BankAccount:
def __init__(self, balance):
self.balance = balance
def make_deposit(self, amount):
self.balance += amount
def make_withdrawal(self, amount):
if self.balance < amount:
print("Error: Not enough funds")
else:
print("Successfully withdrawn $", amount, sep="")
self.balance -= amount
def get_balance(self):
return self.balance
my_account = BankAccount(5000) # Initially account is created with $2000 balance
print("Balance before change:", my_account.balance)
my_account.balance = 0 # well now your balance is 0
print("Balance after change:", my_account.balance)