Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Inside accounts.py , create a class named Account with the methods below. a . def _ _ init _ _ ( self ,
Inside accounts.py create a class named Account with the methods below.
a def initself name, balance:
i This should be used to set the default values for each account object.
ii It should contain private variables accountname, accountbalance that should hold the account name and a balance respectively. Example:
accountone AccountJohn is an account object whose accountname John and accountbalance
accounttwo AccountTom is an account object whose accountname Tom and accountbalance
accountthree AccountTim is an account object whose accountname Tim and accountbalance
iii. After setting the accountbalance, call the setbalance method to check that the account balance is a valid value.
b def depositself amount:
i This should increase the account balance by the specified amount.
ii If the amount is a negative number or nothing should happen to the account balance since you cannot deposit a negative amount of money or $
iii. Return the Boolean value True if the deposit transaction is successful and False if the transaction is unsuccessful didnt change account balance
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started