PLEASE I NEED A LITTLE HELP .
I can figure out what Iam missing in this project

Create a class called BankAccount
.Create a constructor that takes in an integer and assigns this to a `balance` 
property.
.Create a method called `deposit` that takes in cash deposit amount and updates 
the balance accordingly.
.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"`
.Create a subclass MinimumBalanceAccount of the BankAccount class

THIS IS MY SOLUTION

class BankAccount:
def_init_(self, initial_amount):
self.balance=initial_amount

def deposit (self, amount):
self.balance+=amount

def withdraw (self, amount):
if self.balance>=amount:
return ('invalid transaction')

class MinimumBalanceAccount(BankAccount):
def _init_(self):
BankAccount_init_(self)

THIS IS THE ERROR MESSAGE I GOT

Internal Error: runTests aborted: TestOutcomeEvent(handled=False, test=, 
result=, outcome='error', exc_info=(, TypeError('this constructor takes no 
arguments',), ), reason=None, expected=False, shortLabel=None, longLabel=None) 
is not JSON serializable
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to