Question: USING PYTHON 12- Write a function named wordLenghts, it takes two paramters: 1-inFilea string that is the name of the input file and 2-outFile a
USING PYTHON 12- Write a function named wordLenghts, it takes two paramters: 1-inFilea string that is the name of the input file and 2-outFile a string that is the name of the output file.The input file exits when wordLenghts is called; wordLenghts must create the file outFile. the input file contains only letters and white space. For each line of the input file , wordLenghts should identify the lenght of the longest word on the line and how many words of that lenght there are.It should write the lenght of the longest word, followed by a space, followed by how many words of that lenght there are on the line to a corresponding line in the outFile. If a line in the input file is empty the corresponding line of the output file should also be empty
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
