Question
IN PYTHON Write a function named addline that reads a text file and produces an output file which is a copy of the file, except
IN PYTHON
Write a function named "addline" that reads a text file and produces an output file which is a copy of the file, except the first five columns of each line contain a four digit line number, followed by a space. Start numbering the first line in the output file at 1. Ensure that every line number is formatted to the same width in the output file. Use one of your Python programs as test data for this exercise: your output should be a printed and numbered listing of the Python program.
def addline(inName, outName): # inName and outName are strings // TODO
Write a function named "removeNum" that undoes the numbering of the addline function: it should read a file with numbered lines and produce another file without line numbers.
def removeNum(inName, outName): # inName and outName are strings // TODO
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started