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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started