单选题

观察下列程序代码并思考回答:

word=['I','really','like','the','cat','!']
f=open('words.csv','w')
f.write(' '.join(word))
f.close()

有关该段程序,下列说法正确的是?( )


A

'words.csv’文件需事先创建好,否则open()语句会出错

B

变量f表示该CSV文件对象

C

最终f对象中的内容是:I.really.like.the.cat.!

D

程序的主要目的是写入内容,因此f.close()最好不写

赣ICP备20007335号-2