判断题

在 with 中打开文件时,如果显式关闭文件,将导致异常,因为 with 将能自动关闭文件,因此下列Python 代码执行将触发异常。 (     )

with open("123.txt","w") as f:

        for i in range(10):

              print(i,file=f)

f.close()

A 正确
B 错误
赣ICP备20007335号-2