What is the output of the following code:
with open('data.txt', 'a') as file:
file.write('Appended line.')
with open('data.txt', 'r') as file:
content = file.read()
print(content)
file.write('Appended line.')
A. Contents of data.txt with the appended line
B. An error will occur
C. Appended line.
D. file object
Answer: Option D

Join The Discussion