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 01:00
Program description: a c# app is to be created to produce morse code. the morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). in sound-oriented systems, the dot represents a short sound and the dash represents a long sound. separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. in a sound-oriented system, a space is indicated by a short period of time during which no sound is transmitted. the international version of the morse code is stored in the data file morse.txt.
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
Andrina writes letters that are regularly sent to hundreds of her company’s customers. because of this, she would like for the mail merge command to be in her quick access toolbar, and she wants it to be the first button on the left. what should andrina do to place the mail merge button there?
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
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
Geography, 14.07.2019 21:40