Question: Please answer question 8.40 Python 3.0 for language Comment for each part of line of code explaining what is being done 8.40 In Problem 8.20,

Please answer question 8.40
Python 3.0 for language
Comment for each part of line of code explaining what is being done
 Please answer question 8.40 Python 3.0 for language Comment for each
part of line of code explaining what is being done 8.40 In

8.40 In Problem 8.20, there are some problems with the implementation of the class BankAcours and they are illustrated here: xBankAccount (-700) >>>x.balance() -700 >>>x.withdraw(70) >>>x.balance () -770 >>>x.deposit(-7) >>>x.balance ) Balance: -777 The problems are: (1) a bank account with a negative balance can be created, (2) the with- drawal amount is greater than the balance, and (3) the deposit amount is negative. Modify the code for the BankAccount class so that a ValueError exception is thrown for any of these violations, together with an appropriate message: 'Illegal balance', 'Overdraft',or Negative deposit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!