What is the output of the following code:
with open('data.txt', 'w') as file:
file.write('Hello, world!')
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

Join The Discussion