CS 111: Introduction to Computer Science
Your first program: counting lines in a file
Hand in as counter.py.
This assignment is intended to get you started writing Python code
by modifying an existing program to extend its capabilities.
Start by saving a copy of counter.py
and playing around with it to make sure you understand what it does and why.
Next, modify the program like so:
- In the comment at the top of the program, change the authorship
statement to use your name instead of mine, and add a brief citation
"Adapted from a program written by Jeff Ondich" or some such.
- In addition to reporting the number of lines in the file, the
program should report the number of blank lines (i.e. lines with
zero length), the number of lines starting with the word "The"
or "the", and the number of lines whose length is less than 80 characters.
Start early, have fun, and ask questions.