单选题
有一段Python代码,'test1.txt'内容如下图所示,'test2.txt'文件无内容,执行该代码后,下列说法正确的是?( ?)
with open('test1.txt') as f: data=https://tiku.scratchor.com/paper/question_answer/f.readline()with open('test2.txt','w') as f: f.write(data)
A.
test2.txt文件中仍旧无内容
B.
test2.txt文件中的内容为'hello world,'
C.
test2.txt文件中的内容为'hello world,I like Python'
D.
test1.txt文件中的内容将丢失
发表评论 取消回复