Examveda
Examveda

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)

A. Contents of data.txt with the appended line

B. An error will occur

C. Appended line.

D. file object

Answer: Option D


This Question Belongs to Python Program >> Files Handling In Python

Join The Discussion

Related Questions on Files Handling in Python