Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions source/exercises/mailroom/mailroom_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ Here is a potential data structure to consider:

.. code-block:: python

donor_db = [("William Gates, III", [653772.32, 12.17]),
donor_db = [("William Gates, III", [100.0, 120.10]),
("Jeff Bezos", [877.33]),
("Paul Allen", [663.23, 43.87, 1.32]),
("Mark Zuckerberg", [1663.23, 4300.87, 10432.0]),
("Paul Allen", [663.23, 343.87, 411.32]),
("Mark Zuckerberg", [1660.23, 4320.87, 10432.0]),
]

Here we have the first item in a tuple as a donor name, which we will use to determine if we need to add to existing donor or add a new one and the second item is a list of donation values.

Why choose tuples for the inner donor record? Well, another part of using the right data structure is to reduce bugs; you are setting clear expectations that a single donor entry only contains two items.


Expand Down