判断题 偏易
#5625

执行语句 f=open('demo.txt', 'r'),demo.txt 文件必须己经存在,否则会报错。( )

执行语句 f=open('demo.txt', 'r'),demo.txt 文件必须己经存在,否则会报错。(  )

未登录也能判分,登录后才会记录
答案与解析
正确答案:对
解析

执行语句 f=open('demo.txt', 'r') 在打开文件时,如果demo.txt文件不存在,将会抛出FileNotFoundError异常。