Test Index

File Handling in Python Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 33 of 37
Marks: +1, -0
The correct syntax of tell() is :
[CBSE 2023 Compartment]
Solution:  
Concept:
tell() is a method of the file object. It takes no argument and returns the current position of the file pointer (in bytes from the beginning of the file).
Explanation:
A method is called with the object name first:
f = open("data.txt", "r")
print(f.tell()) # 0 at the start
So the syntax is file_object.tell().
Answer:
Option B (file_object.tell())
© examsnet.com
Advertisements
Go to Question: