Question: Please help me with this Assignment, using Python 2.X Write a program that reads through the mail box data and when you find a line

Please help me with this Assignment, using Python 2.X

Write a program that reads through the mail box data and when you find a line that starts with From, extract the address information from the line. Count the number of messages from each person by using a dictionary. Note that you might need to look at more than From because of duplicate instances of the address (hint: From vs. From:). Otherwise, embedded email thread histories may cause your count to be incorrect.

The mail box data mbox.txt can be found at ttp://www.py4inf.com/code/

After all of the data has been read, print (i.e., print) the address of the person with the highest number of messages, along with the number of messages of that person. To do this, create a list of tuples (count, email) from the dictionary, sort the list in reverse order and print out the person who has the highest number of messages.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!