Question: If you have downloaded the source code from the Premium Companion Website you will find a file named text.txt in the Chapter 08 folder. The

If you have downloaded the source code from the Premium Companion Website you will find a file named text.txt in the Chapter 08 folder. The text that is in the file is stored as one sentence per line. Write a program that reads the file’s contents and calculates the average number of words per sentence.

(You can access the Premium Companion Website at www.pearsonglobaleditions.com/gaddis.)

Step by Step Solution

3.47 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

def calculateaveragewordspersentencefilename Calculates the average number of words ... View full answer

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 Starting Out With Python Questions!