Using Python: Write a script which appends a line counter to an input file.  This script creates a program listing from a source program. This script should prompt the user for the names of two files. The script copies the lines of text from the input file to the output file, numbering each line as it goes. The line numbers should be right-justified in 4 columns here in the input and ouput

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Using Python: Write a script which appends a line counter to an input file.  This script creates a program listing from a source program. This script should prompt the user for the names of two files. The script copies the lines of text from the input file to the output file, numbering each line as it goes. The line numbers should be right-justified in 4 columns

here in the input and ouput

 

Input File:
This is the first line.
This is the second line.
Bow-ties are cool.
Output File:
1>This is the first line.
2>This is the second line.
3>Bow-ties are cool.
Transcribed Image Text:Input File: This is the first line. This is the second line. Bow-ties are cool. Output File: 1>This is the first line. 2>This is the second line. 3>Bow-ties are cool.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT