Login using Social Account
     Continue with GoogleLogin using your credentials
Write a function count_message_from_domain
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 domain(Instead of from email address), and returns the dictionary.
If your logic is correct then your function should return below dictionary
{'uct.ac.za': 6,
'media.berkeley.edu': 4,
'umich.edu': 7,
'iupui.edu': 8,
'caret.cam.ac.uk': 1,
'gmail.com': 1}
You can use "Hint" and "See Answer" if you are stuck.
Taking you to the next topic in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...