Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin 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 counts how many messages have come from each domain, stores the count in a Map
, and then returns the Map
. The email can be found by second word after you split every line that starts with 'From:'
If your logic is correct then your function should return below Map
:
Map(umich.edu -> 7, media.berkeley.edu -> 4, caret.cam.ac.uk -> 1, uct.ac.za -> 6, iupui.edu -> 8, gmail.com -> 1)
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...