Question: this is python question please send me ans assp Problem .write a function named repeat-words that takes two string parameters 1 the name of an

this is python question please send me ans assp
Problem .write a function named repeat-words that takes two string parameters 1 the name of an input nie that exists before repeat-words called 2. the name of an output file that repeat words creates Assume that the input file is in the current working directory and wite the output file to that directory For each line of the input file, the function repeat words should wnte to the output file all of the words that appear more than once on that line Each word should be lower cased ailing punctuation Each repeated word on a line should be wriften to the corresponding line of the output tile only once, regardiess of the number of times the word is repeated For example, it the following is the content of the file catin TheHat xt Too wet to go out and too coid to play ball So we sat in the nouse We did nothing at all So all we couid do was to Sit St! St St The following function call InF catinTheHat txt outF 'catRepWords txt repeatwords (inF, outF) should create the file catRepWords txt with the content too to sit Hint Be sure to test your solution with input in which some repeated woros on a line are a mixture of upper and lower case, and in which repeated words or
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
