Question: In python For example, when prompted, if the user specifiessampleprogram.py and that file contains: #Sample program Print(This is a sample program) Your program will produce
1. linenumbers.py) Write a program that asks the user for the name of a file. The program should write the contents of this input file to an output file. In the output file, each line should be preceded with a line number followed by a colon. The output file will have the same name as the input filename, preceded by "1n_" (for linenumbers, so if the selected input file is myfile.txt, the output file would be called 1n_myfile.txt). Be sure to use Try/Except to catch all exceptions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
