create a Python script. Your script should: Ask the user for the name of a file (if the file exists it will be in the current directory). If the file does not exist, your script should inform the user...




create a Python script. Your script should:





Ask the user for the name of a file (if the file exists it will be in the current directory). If the file does not exist, your script should inform the user of the error and let them try again.





Allow the user to exit the program gracefully without actually processing a file - you may choose how to do this, just make sure the user knows!





The program should only display the first five (5) lines of the file's content. If the file contains less than five (5) lines, it should display the file's entire content.





Be sure your script can handle at least the following conditions:





*The file does not exist





*There are no lines in the file





*There are more than five lines in the file





*There are exactly five lines in the file




Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here