Bank Account in Nakfa
Python
15 pts
Bank Account in Nakfa
Finish the BankAccount class:
- Add a class attribute
currency = "Nakfa". - Give
__init__a second parameterbalancewith a default value of 0, and store it asself.balance.
The code at the bottom creates two accounts and prints them. Expected output:
Selam: 0 Nakfa Abel: 500 Nakfa
Checklist
- Add the class attribute
currencywith the value"Nakfa"directly in the class body. - Give
__init__abalanceparameter with the default value0, and store it. - Run the code at the bottom to print both accounts.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
