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
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