Question: Write a program that allows the user to navigate through the lines of text in a file. The program prompts the user for a filename
Write a program that allows the user to navigate through the lines of text in a file.
The program prompts the user for a filename and inputs the lines of text into a list.
The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number.
Actual line numbers range from to the number of lines in the file.
If the input is the program quits.If the input is greater than the lines in the file, prompt the user that the input must be less than or equal to the number of lines in the file.
The program prints the line in the file associated with the input number.
To test your program run the navigate.py file.
Your program's output should look like the following:
Enter the input file name: data.md The file has lines. Enter a line number to quit: : Lambert The file has lines. Enter a line number to quit: : Osborne The file has lines. Enter a line number to quit: : Giacometti The file has lines. Enter a line number to quit:
Task #: Program properly navigates the provided files
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
