Question: Refer to code below. What happens if the members.txt file doesn't exist when the first with open statement is executed? with open ( members
Refer to code below. What happens if the members.txt file doesn't exist when the first with open statement is executed?
with openmemberstxtw as file:
file.writeJohn Cleeseln"
with openmemberstxta as file:
file.writeEric Idlen
a new file named members.txt is created
an exception is thrown but the program doesn't crash
the program crashes
all the resources for the file are released
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
