Q. What is the output of the following program?
Code:f = None
for i in range (5):
with open("data.txt", "w") as f:
if i > 2:
break
print(f.closed)
β
Correct Answer: (A)
True
f = None
for i in range (5):
with open("data.txt", "w") as f:
if i > 2:
break
print(f.closed)
You must be Logged in to update hint/solution