Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use python to write and submit a script that asks for a filename (to which mbox.txt and mbox-short.txt will be used) and looks for lines
use python to write and submit a script that asks for a filename (to which mbox.txt and mbox-short.txt will be used) and looks for lines of the form
New Revision: 39772
Extract the number from each of the lines using a regular expression and the findall() method. Compute the average of the numbers, rounded to a single decimal place, and print out the average and the number of lines used for the computation.
Enter filename: mbox.txt
Average = 38549.8
Number of lines = 1790
Enter filename: mbox-short.txt
Average = 39756.9
Number of lines = 27
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