第26343题 单选
执行以下Python代码,若文件data.txt不存在,输出结果是?
try:
    with open('data.txt', 'r') as f:
        content = f.read()
        print("File read successfully.")
except FileNotFoundError:
    print("File not found.")
except Exception as e:
    print("An error occurred:", e)
A

File read successfully.

B

File not found.

C

An error occurred: ...

D

没有任何输出

提交0次 正确率0.00%
答案解析