9.11. Exercises

9-1. File Filtering. Display all lines of a file, except those that start with a pound sign ( # ), the comment character for Python, Perl, Tcl, and most other scripting languages.

9-2. File Access. Prompt for a number N and file F, and display the first N lines of F.

9-3. File Information. Prompt for a filename and display the number of lines in that text file.

9-4. File Access. Write a “pager” program. Your solution should prompt for a file name, and display the text file 25 lines at a time, pausinLg each time to ask the user to “press a key to continue.”

9-5. Test Scores. Update your solution to the test scores problems (Exercises 5–3 and 6–4) by allowing a set of test scores be loaded from a file. We leave the file format to your ...

Get Core Python Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.