Q41. Which function helps to read randomly from file?
Q42. ____________ function returns the current position of file pointer.
Q43. f.seek(10,0) will move 10 bytes forward from beginning of file.
Q44. Which statement will move file pointer 10 bytes backward from current position.
Q45. When we open file in append mode the file pointer is at the ______ of the file.
Q46. When we open file in write mode the file pointer is at the ______ of the file.
Q47. Write the output of the First Print statements :
f=open("data.txt",'w')
f.write("Hello")
f.write("Welcome to my Blog")
f.close()
f=open("data.txt",'r')
d=f.read(5)
print(d) # First Print Statement
f.seek(10)
d=f.read(3)
print(d) # Second Print Statement
f.seek(13)
d=f.read(5)
print(d) # Third Print Statement
d=f.tell()
print(d) # Fourth Print Statement
Q48. Refer to the above code : Write the output of Second Print Statement
Q49. Refer to the above code : Write the output of Third Print Statement
Q50. Refer to the above code : Write the output of Fourth Print Statement