Examveda

What is the output of the following code:
with open('data.txt', 'w') as file:
file.write('Hello, world!')

A. The file data.txt will contain Hello, world!

B. An error will occur

C. The file data.txt will be empty

D. Hello, world!

Answer: Option C


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

Join The Discussion

Related Questions on Files Handling in Python