Exercise 1: Write a Python program that reads from the user the name of two files (an input file and an output file). The program will then read each line of the input file and save it in the output...


Exercise 1:<br>Write a Python program that reads from the user the name of two files (an input file and an output<br>file). The program will then read each line of the input file and save it in the output file preceded<br>with the line number and removing any of the following punctuations (. , ! ?; :) found at the end of<br>the line. For example, if the input file is:<br>Mary had a little lamb;<br>Whose fleece was white as snow;<br>And everywhere that Mary went;<br>The lamb was sure to go!<br>Then the output file the content of the input file and saves it in the produced output file will be<br>Line 1: Mary had a little lamb<br>Line 2: Whose fleece was white as snow<br>Line 3: And everywhere that Mary<br>Line 4: The lamb was sure to go<br>

Extracted text: Exercise 1: Write a Python program that reads from the user the name of two files (an input file and an output file). The program will then read each line of the input file and save it in the output file preceded with the line number and removing any of the following punctuations (. , ! ?; :) found at the end of the line. For example, if the input file is: Mary had a little lamb; Whose fleece was white as snow; And everywhere that Mary went; The lamb was sure to go! Then the output file the content of the input file and saves it in the produced output file will be Line 1: Mary had a little lamb Line 2: Whose fleece was white as snow Line 3: And everywhere that Mary Line 4: The lamb was sure to go

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here