Vineesh-AI-DS / copy-file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

copy-file

AIM:

To write a python program for copying the contents from one file to another file.

EQUIPEMENT'S REQUIRED:

PC Anaconda - Python 3.7

ALGORITHM:

Step 1: Open visual studio code.

Step 2: Create file with .py extension.

Step 3: Start the program.

Step 4: Write the code.

Step 5: Run terminal for output of the given program.

Step 6: End the program.

PROGRAM:

# Developed by Vineesh.M
# Ref No : 21004131
# To write a program for copying the contents from one file to another file.

with open ('copy1.txt') as c1:
    with open ('copy2.txt','w') as c2:
        for line in c1:
            c2.write(line)

OUTPUT:

Screenshot (54) Screenshot (55) Screenshot (56)

RESULT:

Thus the program is written to copy the contents from one file to another file.

About

License:BSD 3-Clause "New" or "Revised" License