English

Write the missing statement to complete the following code: file = open("example.txt", "r") data = file.read(100) ____________ #Move the file pointer to the beginning of the file next_data - Computer Science (Python)

Advertisements
Advertisements

Question

Write the missing statement to complete the following code: 

file = open("example.txt", "r")
data = file.read(100)
____________ #Move the file pointer to the 
beginning of the file
next_data = file.read(50)
file.close()
Code Writing
Fill in the Blanks
Advertisements

Solution

file = open("example.txt", "r")
data = file.read(100)
file.seek(0) #Move the file pointer to the 
beginning of the file
next_data = file.read(50)
file.close() 
shaalaa.com
  Is there an error in this question or solution?
2024-2025 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×