Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106384

Re: i cant seem to figure out the error

From Jason Friedman <jsf80238@gmail.com>
Newsgroups comp.lang.python
Subject Re: i cant seem to figure out the error
Date 2016-04-03 11:37 -0600
Message-ID <mailman.405.1459705037.28225.python-list@python.org> (permalink)
References <CABMxrODHsfZuSUSWT1AkBDAUzC9U5=MheXQv01QOsTNiSE2a=w@mail.gmail.com>

Show all headers | View raw


>   def deposit(self, amount):
>     self.amount=amount
>     self.balance += amount
>     return self.balance
>
>
>   def withdraw(self, amount):
>     self.amount=amount
>     if(amount > self.balance):
>       return ("Amount greater than available balance.")
>     else:
>   self.balance -= amount
>     return self.balance

Also, this line is not needed in the deposit and withdraw methods:

self.amount=amount

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: i cant seem to figure out the error Jason Friedman <jsf80238@gmail.com> - 2016-04-03 11:37 -0600

csiph-web