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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.