Question: Python 3.6 Question 13 20 points Write a function named lineStats that finds the number of words and the number of characters on each line

Python 3.6

Python 3.6 Question 13 20 points Write a function named lineStats that

Question 13 20 points Write a function named lineStats that finds the number of words and the number of characters on each line of a file and writes those statistics to a corresponding line of a new file, separated by a space. (Hint: when you read a line from a file, the endline character is included. Do not include the endline in the number of characters on the line.) The Tunction Iznestats takes two par ameters: 1. infile, a string, the name of an input file that exists before ineStats is called 2. outfile, a string, the name of an output file that lineStats creates and writes to For example, if the following is the content of the file promisedLand. txt: The dogs on main street howl, "cause they understand, And I believe in a promised land 1 belzeve 1n a promised lana The following function call: inF ' promisedand . txt' outF ' promisedandstats. txt ' linestats(inF, outF) should create the file promisedLandStats.txt with the content: 6 29 3 23 7 32 6 31

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!