单选题

有一段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文件中的内容将丢失

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部