Articles → PYTHON → Tell Function In PythonTell Function In PythonIn this article, we will discuss the "tell" function of the file object in python.Purpose "tell()" function returns the current position of the file object. Initial position of the file object is zero.Example Consider the following codemyfile = 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 Click to EnlargePosted 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