Write a function count_message_from_email
which reads the file /cxldata/datasets/project/mbox-short.txt
.
This function builds a histogram using a dictionary to count how many messages have come from each email address and returns the dictionary.
Output:
If your logic is correct then your function should return a dictionary like the following:
{'stephen.marquard@uct.ac.za': 2, 'louis@media.berkeley.edu': 3, 'zqian@umich.edu': 4, 'rjlowe@iupui.edu': 2, 'cwen@iupui.edu': 5, 'gsilver@umich.edu': 3, 'wagnermr@iupui.edu': 1, 'antranig@caret.cam.ac.uk': 1, 'gopal.ramasammycook@gmail.com': 1, 'david.horwitz@uct.ac.za': 4, 'ray@media.berkeley.edu': 1}
You can use "Hint" and "See Answer" if you are stuck.
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Please login to comment
0 Comments
There are 229 new comments.