Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python 3.6 Question 12 (20 points) Write a function named lineStats. The function lineStats takes two string parameters: the name of an input file and
Python 3.6
Question 12 (20 points) Write a function named lineStats. The function lineStats takes two string parameters: the name of an input file and the name of an output file. The function lineStats should read and analyze each line of the input file and write two statistics about the line to a corresponding line of the output file. The statistics to compile for each line are 1) the number of unique words 2) the number of unique characters (including the space character but not including the endline character) Upper and lower case characters are the same (A' and 'at are the same word, for example). The input file contains only upper and lower case letters and white space If the input file contains the following lines: Step right up step right up step right up Everyone a winner bargains galore Then an output file with the following lines would be correct: words 3 chars 11 words 5 chars 15Step 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