Login using Social Account
     Continue with GoogleLogin using your credentials
Write a function find_email_sent_days
which reads the file /cxldata/datasets/project/mbox-short.txt
and categorizes each mail message by which day of the week the email was sent.
To do this do the following:
> Note: You have to store the results in a dictionary
. Only store those day of the week that exists. For Example, if there is no line for Mon
then it should not be in the dictionary elements.
dictionary
(order does not matter)Sample Lines from the file:
From stephen.marquard@uct.ac.za Sat Jan 5 10:14:16 2008
From stephen.marquard@uct.ac.za Sat Jan 5 15:14:16 2008
From stephen.marquard@uct.ac.za Sun Jan 6 09:14:16 2008
Output:
{'Sat': 2, 'Sun': 1}
PS - If your logic is correct then your function should return this dictionary {'Sat': 1, 'Fri': 20, 'Thu': 6}
. 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.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...