File Handling Quiz-10

Share with others

Welcome to your File Handling Quiz-10

Q91. In order to read the content from the file, we can open file in ___________

Q92. Which of the following method is used to read a specified number of bytes of data from a data file.

Q93. Write the output of the following:

f=open("test.txt","w+")
f.write("File-Handling")
a=f.read(5)
print(a)

Q94. Write the output of the following:

f=open("test.txt","w+")
f.write("File-Handling")
f.seek(0)

a=f.read(5)
print(a)

Q95. Write the output of the following:

f=open("test.txt","w+")
f.write("FileHandling")
f.seek(5)

a=f.read(5)
print(a)

Q96. Write the output of the following:

f=open("test.txt","w+")
f.write("FileHandling")
f.seek(0)

a=f.read()
print(a)

Q97. Write the output of the following:

f=open("test.txt","w+")
f.write("FileHandling")
f.seek(0)

a=f.read(-1)
print(a)

Q98. Which of the following method reads one complete line from a file?

Q99. Write the output of the following:

f=open("test.txt","w+")
f.write("File\nHandling")
f.seek(0)
a=f.readline(-1)
print(a)

Q100. Write the output of the following:

f=open("test.txt","w+")
f.write("File\nHandling")
f.seek(0)
a=f.readline(2)
print(a)


Share with others

Leave a Reply

error: Content is protected !!