Question: Write a python 3.5 program that can generate the output shown for the .txt file. Use proper indentation. 2 Lab Questions l. Write a program

Write a python 3.5 program that can generate the output shown for the .txt file. Use proper indentation.

Write a python 3.5 program that can generate the output shown for

2 Lab Questions l. Write a program called q1.py that analyzes and prints file statistics. First, prompt the user for the name of a file. Then, read and analyze the file and display the following statistics: total number of characters, number of sentences, and number of words. Here are some notes regarding the above statistics you will collect. A character is any symbol in the text file. Examples of characters include letters. numerical digits, punctuation marks, and "invisible" characters such as whitespace and new line characters. Assume a word is separated by whitespace and/or newline characters Assume sentences end in either a period, question mark, or exclamation point Programming tips You'll need to take advantage of the strip() and split f tions for strings. Please see the Topic 3 lecture notes (along with in-class programs) for examples of reading files and stripping and splitting strings. Example #1. The user enters the filename five-letter-words. txt (line 1). The output of the program is then displayed (lines 3 5). Enter a filename: five letter words. txt 3 Characters 16500 Sent ences Words 2750 Example #2. The user enters the file getty sburg.txt e 1). The output of the program is then displayed (lines 3 5). Enter a fil en ame gettysburg .txt 3 Characters 1447 Sentences 10 Words 267

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!