subject
Engineering, 18.12.2019 06:31 ethannila

Word freq dictionary: write a program that reads in a text file and counts instances of each word, recording those instances in a dictionary. then it should print out that information in a new file.

the program should:
read in each line from the input file
split each line into words by spaces
remove periods, question marks, commas, and periods from the end of each word using the string. strip method
remove quotation marks ('\'','"') from beginning and end of words
count the occurrences of the words using a dictionary
write out the dictionary information into a file in a consistent format (e. g., word: number, .tsv, .csv, etc.)

ansver
Answers: 2

Another question on Engineering

question
Engineering, 03.07.2019 23:20
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
question
Engineering, 04.07.2019 18:10
Which of the following components of a pid controlled accumulates the error over time and responds to system error after the error has been accumulated? a)- proportional b)- derivative c)- integral d)- on/off.
Answers: 2
question
Engineering, 04.07.2019 18:20
Inadequate stores control is not an obstacle to effective work order system. (clo4) a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:20
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
You know the right answer?
Word freq dictionary: write a program that reads in a text file and counts instances of each word,...
Questions
question
Mathematics, 01.10.2019 00:30
question
Computers and Technology, 01.10.2019 00:30