Question: Write a program that prompts a user for any file name. Then prompt the user for a line number and display that line of the

Write a program that prompts a user for any file name. Then prompt the user for a line number and display that line of the file to the user. Use exception-handling code (instead of importing os and using os.path.isfile(file_name)) to ensure the file exists; reprompt if it doesn't. Also use exception-handling code when converting the user's line inputs to integers; reprompt if the input is not an integer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!