Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 15

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

Step: 3

blur-text-image

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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago