Question: Write a program to copy a file into another file duplicating each line. Ex . : input File: Python is fun. I like programming. Output

Write a program to copy a file into another file duplicating each line.
Ex.:
input File:
Python is fun.
I like programming.
Output File:
Python is fun.
Python is fun.
I like programming.
I like programming.
Question (2)(Total: 100 points)
Write a program to read in a file containing numbers. Each line is composed of only one single number.
You should create an output file containing the square of each number from the first file.
Ex.:
input File:
1
5
2
4
Output File:
1
25
4
16

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!