- tell() is a file handling function in python programming language which are used to find the number of character in the text file.
- tell() operation will work when the other operation was work like read, write etc.
Syntax-
f=open(filename,mode)
f.tell()
Example-
file contain one line string like -"This is my file"
then tell() return 15
program-
#write data into file in multiple lines
f=open('myfile.txt','w')
f.write("This is the string")
f.close()
#read the file
f=open('myfile.txt','r')
print(f.read())
print(f.tell())
f.close()
This is the string
18
#write data into file in multiple lines
f=open('myfile.txt','w')
f.write("This is the string")
f.close()
#read the character
f=open('myfile.txt','r')
print(f.tell())
f.close()
0