Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started