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 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 03.07.2019 15:10
Apiston-cylinder with a volume of 0.25 m3 holds 1 kg of air (r 0.287 k/kgk) at a temperature of 100 c. heat transfer to the cylinder causes an isothermal expansion of the piston until the volume triples. how much heat is added to the piston-cylinder?
Answers: 3
question
Engineering, 04.07.2019 18:10
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
question
Engineering, 04.07.2019 18:10
Calculate the bore of a cylinder that has a stroke of 18 inches and an extension time of 6 seconds at a flow rate of 4 gal/min.
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
Social Studies, 17.10.2020 09:01
question
Mathematics, 17.10.2020 09:01
question
Business, 17.10.2020 09:01
Questions on the website: 13722363