1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dimaraw [331]
3 years ago
10

1. (4 points) Write a function, called word_frequency, which takes a file name as a formal parameter and find the occurrence fre

quency of each distinct word in the file. Consider to use the following algorithm: A. Prepare a dictionary to keep track of the count of each word. B. Open the file. C. For each line in the file do: C.A Break the line into words using spaces in between. C.B Clean each word: strip leading and trailing whitespaces, digits and punctuation characters and convert uppercase letters to lowercase. C.C Update word occurrence count in the word count dictionary. Each item in the dictionary has a word as key and the count of the word as value. D. Close the file. E. Return the dictionary. These are the symbols and digits to be stripped off from words: punctuation

Computers and Technology
1 answer:
Troyanec [42]3 years ago
8 0

Answer:

Check the explanation

Explanation:

CODE

def total_word_count(words):

total = 0

#Loop through all words

for word in words:

#Find total

total = total + words[word]

return total

Kindly check the attached image below for the code output.

You might be interested in
Which of the following is NOT shown on a PERT chart? (Points : 2) Scheduled start date
Reptile [31]

Answer:

Estimated Duration

Explanation:

A PERT Chart is a tool in Project Management that gives a graphical portrayal of an undertaking's timetable. The Program Evaluation Review Technique abbreviated as PERT separates the individual assignments of a venture for investigation.  

The most widely recognized components utilized in a PERT chart are:  

  • Span time.  
  • Activity
  • Early finish time.  
  • Early Ending time
  • Late initiation time.  
  • Late completion time.  
  • Critical path
  • Slack.  

It does not include the Estimated span of time.

4 0
3 years ago
_____________ is the process of inspecting data that has been input to a program to make sure it is valid before it is used in a
Maksim231197 [3]

Answer: E) Input validation

              C) Data validation

Explanation:

  • Input validation is the process of analyzing and testing input's quality and correctness that are being processed at further level in information system.It help in eliminating any type of improper or informal input data from getting supplied to user or program in a system.
  • Input validation is also known as data validation.As the input that is being tested and validated is form of data that is going through cleansing task to remove useless data.
  • According to the question, data and input are being inspected to extract the validity and correctness of it before sending it for computation .Thus , both data and input validation is happening in this case.
  • Other options are incorrect because testing is examining the data.Correction data and input is the step for rectifying the mistakes in data or input.
  • Thus, the correct option is option(C) and (E).

4 0
4 years ago
Importancia del sistema operativo
love history [14]

Answer:

Un sistema operativo es el software más importante de tu computador, ya que se encarga de gestionar el hardware, el acceso a la memoria, acceso a la CPU y controlar gran parte de las tareas que lleva a cabo tu computador.

7 0
3 years ago
Given an int variable k that has already been declared, use a while loop to print a single line consisting of 88 asterisks. Use
Grace [21]

Answer:

True

Explanation:

The while loop is going to be executed until the condition is false.

Since <em>k</em> is initially equal to 1, the loop will execute 88 times. One asterisk will be printed and <em>k</em> will be incremented by one during each iteration.

When <em>k</em> becomes 89, the condition will be false (89 is not smaller or equal to 88) and the loop will stop.

6 0
3 years ago
For questions 19 - 21, assume that Student, Employee and Retired are all subclasses of Person, and all four classes have differe
Helga [31]

Answer:

Person

Explanation:

At

Person p = new Person(...);

int m1 = p.getMoney( ); // assignment 1

Person class which is base class for all sub class (Student, Employee and Retired ) creates an object which referenced is stored in p variable, and  getMoney()  is method which refereed Person's getMoney() method, so Person is the answer of above question

6 0
4 years ago
Other questions:
  • Front office employees at the Melville Lodge use a computer-based system to manage, among other things, the central reservation
    13·1 answer
  • What structures in which lighting heating and other systems are controlled by computers
    14·1 answer
  • Host A is a PC, connected to switch SW1 and assigned to VLAN 1. Which of the following are typically assigned an IP address in t
    13·1 answer
  • What is HTML ? <br>Give a small description about html
    12·2 answers
  • Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive.
    8·1 answer
  • // This program assigns values to two variables // and performs mathematical operations with them public class DebugFour1 { publ
    7·1 answer
  • What are the advantages of Database management system (DBMS)??<br>At least mention six of them​
    10·1 answer
  • Who has more Tanks? Russia or USA? You get ti right and you get BRAINLIEST
    12·2 answers
  • 4.(L.5.1.A) Select the sentence that includes an interjection,
    12·1 answer
  • Which describes the "Network Effect?"
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!