02 Prepare : Checkpoint B
Objective
Demonstrate file reading.
Overview
Write a Python 3 program that reads an input file and counts the number of words and the number of lines in that file.
Sample Output
Enter file: /home/cs241/check02b/file1.txt
The file contains 3 lines and 10 words.
You may assume that all words are separated by a space character (i.e., " ").
Automatic Grading Script (TestBed)
This assignment is pass/fail. In order to receive credit, it must pass the auto-grading test script (TestBed). You can run this script as many times as you like while you are working on the assignment. The same test script will be run by the instructor for credit, so you should not be surprised at the result.
To run the test script, log into the CS Department Linux system and run the testBed command, providing the class and test script to run as well as the Python program to use, for example:
testBed cs241/check02b check02b.py
Submission
Submit your program by logging into the CS Department Linux system, and running the submit command with your filename, for example:
submit check02b.py
You should then select the appropriate course (CS 241), instructor, and assignment from the list.