71. How do you change the file position to an offset value from the start?
72. How can you open a file for both reading and writing in Python?
73. What is the difference between r+ and w+ modes?
74. What is the purpose of the b mode when opening a file in Python?
75. What is the output of the following code:
with open('data.txt', 'r') as file:
lines = file.read().splitlines()
print(len(lines))
with open('data.txt', 'r') as file:
lines = file.read().splitlines()
print(len(lines))
76. What is the current syntax of rename() a file?
77. What will be the output of the following Python code?
fo = open("foo.txt", "wb")
print "Name of the file: ", fo.name
fo.flush()
fo.close()
fo = open("foo.txt", "wb")
print "Name of the file: ", fo.name
fo.flush()
fo.close()