Question: Pyhon 3.6 Question 12 Write a function named repeatWords). The function repeatWords() takes two string parameters: the name of an input file and the name
Pyhon 3.6

Question 12 Write a function named repeatWords). The function repeatWords() takes two string parameters: the name of an input file and the name of an output file. The input file contains only lower case letters and white space. The function repeatWords() should identify the word(s) that appear more than once in the file and write each such word to a line of the output file, followed by the number of times that the word appears. A repeated word should be written to only a single line of the output file, no matter how many times it appears in the input file. The order that the words are written to the output file does not matter. For example, if the input file contains the following lines: i would not like them here or there i would not like them anywhere Then an output file with the following lines would be correct: like 2 not 2 i 2 would 2 them 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
