Skip to content

Commit cb5441e

Browse files
authored
Merge pull request #20 from maratnugmanov/patch-5
Update 4-defining-methods.md
2 parents 96a3c06 + 392859c commit cb5441e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

data/part-8/4-defining-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ peters_account = BankAccount("12345-678", "Peter Python", 1500.0, 0.015)
3131

3232
```python
3333
# Example 2: bank account with dictionary
34-
peters_account = {"account_number": "12345-678", "owner": "Peter Python", "balance": 1500.0, "annual_interest": 0.0}
34+
peters_account = {"account_number": "12345-678", "owner": "Peter Python", "balance": 1500.0, "annual_interest": 0.015}
3535
```
3636

3737
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`.

0 commit comments

Comments
 (0)