Menu

[solved]-Write Program First Creates File Called Testtxt Writes Following Context Three Separate Li Q38991461

Write a program that first creates a file called “test.txt” andwrites the following context (in
three separate lines) into it:
This is line 1
This is line 2
This is line 3
Then the program reads from the same file using the readline methodand prints out the
first two lines of the file.
Then the program writes to the same file a fourth line with thetext:
“This is the fourth line”.
And then prints out the rest of the lines from the file until theend of the file is reached
(assuming you do not know exactly how many lines exist in thefile).
So the output should look like:
This is line 1
This is line 2
This is line 3
This is the fourth line

please write the program in python language

Expert Answer


Answer to Write a program that first creates a file called “test.txt” and writes the following context (in three separate line… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *