diff --git a/data/part-8/4-defining-methods.md b/data/part-8/4-defining-methods.md index b4c5f3c4..119ad23a 100644 --- a/data/part-8/4-defining-methods.md +++ b/data/part-8/4-defining-methods.md @@ -31,7 +31,7 @@ peters_account = BankAccount("12345-678", "Peter Python", 1500.0, 0.015) ```python # Example 2: bank account with dictionary -peters_account = {"account_number": "12345-678", "owner": "Peter Python", "balance": 1500.0, "annual_interest": 0.0} +peters_account = {"account_number": "12345-678", "owner": "Peter Python", "balance": 1500.0, "annual_interest": 0.015} ``` With a dictionary the implementation is much shorter and more straightforward. With a class, however, the structure is more "tightly bound", so that we can expect all `BankAccount` objects to be structurally alike. A class is also named. The `BankAccount` class is referenced when creating a new bank account, and the type of the object is `BankAccount`, not `dict`.