Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7 . 3 1 LAB: Copying a file Write a program that copies one file to another. Prompt the user for the input and output

7.31 LAB: Copying a file
Write a program that copies one file to another. Prompt the user for the input and output file names. **use inf.read().
Ex: If the file input.txt contains:
Mary had a little lamb
Whose fleece was white as snow.
And everywhere that Mary went,
The lamb was sure to go!
the file output . txt will also contain:
Mary had a little lamb
Whose fleece was white as snow.
And everywhere that Mary went,
The lamb was sure to go!
A run of the program is:
Enter input file name: mary.txt
Enter output file name: output.txt
Unit tests will be provided for testing and comments are included in the template to guide you. You do not need to include any print
statements for the output.
You can download the mary.txt file to test your code in your IDE, if needed.
537576.3921424.qx3zqy7
LAB
ACTIVITY
7.31.1: LAB: Copying a file
014
Downloadable files
Download
main.py
Load default template...
##
# Copy a file, with the file names provided on the command line.
#
# Read in file names
# Open the files.
# Read the data from the input file and save it in the output file.
# Close the files.
Run your program as often as you'd like, before submitting for grading. Below, type any needed
inputvalues in the first hox then click Run nroaram and observe the program's output in the
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions