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 करता है।
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad