asked 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?

asked
User Jac
by
7.8k points

2 Answers

11 votes

Answer:

There will be 3 lines of data left

Step-by-step explanation:

answered
User Vishal Anand
by
9.1k 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

answered
User Rahul Choudhary
by
8.6k points