Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gmolveau
GitHub Repository: gmolveau/python_full_course
Path: blob/master/exercices/oop/bank/README.md
306 views

Applying the object paradigm, in a bank.py script, define a bank account object. This object will have a balance and a holder. It should be possible to add money to the account and withdraw money from it. It should also be possible to make a transfer between 2 accounts.

After defining the class, make an example by instantiating an account, adding 100 units and withdrawing 30 units, then displaying the final balance.

Then instantiate a second account and transfer 70 units from the first account to the second.

Even if this example isn't "real", beware of errors and extremes.

(be sure to code cleanly, and in English).