Report Bug
Qus :

What is the output of following?

f = open("test.txt", "r")
f.seek(0)
print(f.tell())

Qus

निम्न code का output क्या होगा?

f = open("test.txt", "r")
f.seek(0)
print(f.tell())


A. 0
B. 1
C. File size
D. Error


Solution
A. 0



Explanation
seek(0) moves the file pointer to the beginning; tell() therefore returns 0. <br><br> seek(0) file pointer को शुरुआत में ले जाता है, इसलिए tell() 0 return करता है।



Report Bug