158k views
1 vote
A file named "songs.txt" exists and has 70 lines of data. You open the file with the following line of code.

aFile = open("games.txt", "w")
You write three lines to the file in the program. How many lines are in the file when you close your file?

User Jac
by
4.7k points

2 Answers

11 votes

Answer:

There will be 3 lines of data left

Step-by-step explanation:

User Vishal Anand
by
5.8k points
2 votes

Answer:

There will be 3 lines of data left

Step-by-step explanation:

When you use "w" command it overwrites all lines that already exists, to avoid this use "a" instead to append lines of data onto the text file

User Rahul Choudhary
by
5.4k points