text: #/usr/bin/env python
  # -*- coding: utf-8 -*- 
  
  import persistent
  
  class OutOfFunds(Exception):
      pass
  
  class Account(persistent.Persistent):
      def __init__(self, name, starting_balance=0):
  	self.name = name
  	self.balance = starting_balance
  
      def __str__(self):
  	return "Account %s, balance %s"  % (self.name, self.balance)
  
      def __repr__(self):
  	return "Account %s, balance %s"  % (self.name, self.balance)
  
      def deposit(self, amount):
  	self.balance += amount
  	return self.balance
  
      def withdraw(self, amount):
  	if amount > self.balance:
  	    raise OutOfFunds
  	self.balance -= amount
  	return self.balance
  