We have already seen writing to text files, which we start by opening a file for output:
my_file = open("my_file.txt", "w")
If a file by that name already exists in the directory in which we are planning to save that, the old file will be lost.
We can write two line in that file by writing:
print("First line", file=my_file)
print("Second line", file = my_file)
After we finish writing in the file, we can close it by writing:
temp_file.close()
Write a program that will read in lines of text and it will then write these to a file. Before you close the file, write the number of lines that you wrote in the file.
Submit the program and the output file along with a flowchart and with pseudocode for the program