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 करता है।
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad