Question: Python 3.6 Question 12 (2e points) Write a function named mostFrequent that takes two parameters: 1) inFile, a string that is the name of an

Python 3.6

Python 3.6 Question 12 (2e points) Write a function named mostFrequent that

Question 12 (2e points) Write a function named mostFrequent that takes two parameters: 1) inFile, a string that is the name of an input file 2) outFile, a string that is the name of an output file The input file inFile exists when mostFrequent is called; mostFrequent must create outFile. The input file contains only lower case letters and white space. The function mostFrequent identifies the letter (s) that appear most frequently on each line of inFile and writes them to a corresponding line of outFile. If more than one letter on a line has the same frequency, they should each be written to outFile. Each letter should be written to a line only once For example, if the file moreYouKnow.txt contains the following lines: the more that you read the more things you will know then the function call mostFrequent ( 'moreYouRead.txt', 'moreYouReadout.txt') should produce an output file moreYouReadout.txt with the following lines: 0 Hint: the space character is not a letter and so can not be a most frequent letter

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!