subject
Computers and Technology, 08.01.2020 07:31 bm42400

Write a program to look for lines of the form: new revision: 39772and extract the number from each of the lines using a regular expression and the findall() method. compute the average of the numbers and print out the average. there are two data files. you must ask the user for the name of the file he wishes to process. you may assume that he will always enter either mbox. txt or mbox-short. txt. that is, you don't have to do any error trapping (no try/catch).your program should look for lines that begin with the text "new revision: " followed by any number of spaces, followed by any number of digits. extract the digits (they will be extracted as a string and will be inserted into a list that has the string as the only element, e. g. ["12345"]).convert each number into an integer (they will all be integers, no floating point numbers). count the number of such lines that you encounter and sum the numbers. at the end, print out the sum, the count, and the average (sum/count). below is the output for each file. you should get the same results. enter file: mbox. txtsum: 69004133count: 1790average: 38549.79497206704enter file: mbox-short. txtsum: 1073437count: 27average: 39756.92592592593

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
Where can page numbers appear? check all that apply. in the header inside tables in the footer at the bottom of columns at the top of columns
Answers: 1
You know the right answer?
Write a program to look for lines of the form: new revision: 39772and extract the number from each...
Questions
question
History, 21.08.2019 07:10
Questions on the website: 13722360