Menu

[solved]-Happens Following Code Segment Executes Testtxt Exist Infile Open Testtxt R Question 11 Op Q39009791

What happens when the following code segment executes iftest.txt does not exist?

infile = open(“test.txt”, “r”)

Question 11 options:

A)

The file test.txt is created as a new empty file

B)

The program raises an exception

C)

All attempts to read from the file return an empty string

D)

All attempts to read from the file return random values

Expert Answer


Answer to What happens when the following code segment executes if test.txt does not exist? infile = open(“test.txt”, “r”) Questio… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *