Question: Exercise 1 Problem Write a program that reads a text file and returns the number of lines as well as the total number of characters

Exercise 1
Problem
Write a program that reads a text file and returns the number of lines as well as the
total number of characters in the file.
Expected Output
The first two lines of your code must look like this:
import sys
test_file = hys.argv[1]
This allows for different text files to be sent to your program for testing. Hint, to
open the file use with open(test_file, "r"... The TRY IT button below will
send a test file to your program. You should see the following output:
Exercise 1 Problem Write a program that reads a

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 Programming Questions!