PCAP

Study mode — explanations shown

1

Exceptions and File I/O

hard

Refer to the exhibit. If both data.txt and backup.txt do not exist, what is the output?

Exhibit

try:
    with open('data.txt') as f:
        print(f.read())
except FileNotFoundError:
    try:
        with open('backup.txt') as f:
            print(f.read())
    except FileNotFoundError:
        print('No file found')
0 of 119 answered