[Tutor] Help on Python Assignment

christopher lavezza clavezza at hotmail.com
Sun Jun 6 17:18:09 EDT 2004


Hello.


This program written has a syntax error in it.  Can anyone help me out to 
fix the problem.



Chris


import time
>>>class Account:
	def __init__(self, initial):
		self.balance = initial
		self.payactions={}
	def deposit(self,amt):
		self.balance=self.balance+amt
		t=time.strftime('%a, %d %b %Y %H:%M:%S', time.localtime(time.time() + 0))
		self.payactions[amt]=t
	def withdraw(self,amt):
		if self.balance-amt<0:
			print 'Not enough Mojo in your account!'
		else:
			self.balance=self.balance-amt
			t=time.strftime('%a, %d %b %Y %H:%M:%S', time.localtime(time.time() + 0))
			self.payactions[-amt]=t
	def printbalance(self):
		print 'Date			Activities'
		for k, v in self.payactions.iteritems():
			print v,'	',k
			print 'Total:'+str(self.balance)

_________________________________________________________________
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! 
http://join.msn.click-url.com/go/onm00200362ave/direct/01/




More information about the Tutor mailing list