Re: i cant seem to figure out the error

2016-04-03 Thread Erik
Hi Anthony, On 03/04/16 16:06, anthony uwaifo wrote: please i need help with this assignment. I have written a code and i still get an error. please help me debug my code. We see this assignment come up a lot. The "tutor" list is a better place to go, but well done for at least attempting it

Re: i cant seem to figure out the error

2016-04-03 Thread MRAB
On 2016-04-03 18:34, Jason Friedman wrote: - Create a method called `withdraw` that takes in cash withdrawal amount and updates the balance accordingly. if amount is greater than balance return `"invalid transaction"` def withdraw(self, amount): self.amount=amount if(amount >

Re: i cant seem to figure out the error

2016-04-03 Thread Peter Pearson
On Sun, 3 Apr 2016 16:06:58 +0100, anthony uwaifo wrote: [snip] > > class BankAccount(object): > def __init__(self, balance): > self.balance = balance > > > def deposit(self, amount): > self.amount=amount > self.balance += amount > return self.balance > > > def withdraw(self,

Re: i cant seem to figure out the error

2016-04-03 Thread MRAB
On 2016-04-03 16:06, anthony uwaifo wrote: hi everyone, please i need help with this assignment. I have written a code and i still get an error. please help me debug my code. instructions: - Create a constructor that takes in an integer and assigns this to a `balance` property. - C

Re: i cant seem to figure out the error

2016-04-03 Thread Jason Friedman
> 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 -= amou

Re: i cant seem to figure out the error

2016-04-03 Thread Jason Friedman
> >- Create a method called `withdraw` that takes in cash withdrawal amount >and updates the balance accordingly. if amount is greater than balance >return `"invalid transaction"` > > def withdraw(self, amount): > self.amount=amount > if(amount > self.balance): > return

i cant seem to figure out the error

2016-04-03 Thread anthony uwaifo
hi everyone, please i need help with this assignment. I have written a code and i still get an error. please help me debug my code. instructions: - Create a constructor that takes in an integer and assigns this to a `balance` property. - Create a method called `deposit` that takes in ca