Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Influxdb Database A Comprehensive Guide To Learn Influxdb Database

Authors: Cybellium Ltd ,Kris Hermans

1st Edition

B0CNGGWL7B, 979-8867766450

More Books

Students also viewed these Databases questions

Question

b. Determine the number of dependent variables, p. Pg45

Answered: 1 week ago