Articles → PYTHON → Tell Function In PythonTell Function In PythonIn this article, we will discuss the "tell" function of the file object in Python.Purpose The "tell()" function returns the current position of the file object. The initial position of the file object is zero.Example Consider the following code: -myfile = open("c:\\temp\\gyan.txt", "w") myfile.write("Hi") print(myfile.tell()) myfile.close()In the above code, we are creating the new file and writing the content "Hi" in the file. Output Posted By - Karan Gupta Posted On - Sunday, September 12, 2021 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
myfile = open("c:\\temp\\gyan.txt", "w") myfile.write("Hi") print(myfile.tell()) myfile.close()
Query/Feedback