QUESTION IMAGE
Question
a file named \games.txt\ exists and has 80 lines of data. you open the file with the following line afile = open(\games.txt\, \w\) you write two lines to the file in the program. how many lines are in the file when you close your
Step1: Understand file - opening mode
The "w" mode in the open function truncates the existing file, deleting all its contents.
Step2: Count lines after writing
After truncating the file, only the two lines that are written are present in the file.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
2