Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assistance with python program

Status
Not open for further replies.

coled32

IS-IT--Management
Oct 29, 2003
1
US
I need assistance with this program that I am trying to build. I need to allow users to input the amount of cash deposited, the amount of cash withdrawn and to get a report of the balance at any given time, add the date of each deposit and the date of each withdrawal and provide a date with the balance returned upon a given query. This is what I have so far:

class Account:
def __init__(self, initial):
self.balance = initial
print "your current balance is", self.balance
def deposit(self,input):
print "your current balance is", self.balance + deposit
self.balance = self.balance + deposit
def withdraw(self,withdrawal):
self.balance = self.balance - withdrawal
print "your current balance is", self.balance
def getbalance(self):
print "your balance is", self.balance + deposit - withdrawal

a = Account(1000.00)
deposit = input("what is your deposit ")
withdrawal = input("what is your withdrawal ")
print a.getbalance ()
import time
print time.ctime(time.time())


Any suggestions? Thanks for your time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top