测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A17829. 已知text.txt中有两行文字,运行以下Python代码说法正确的选项是?( )f = open('test.txt','r') s1 = f.read() f.close() f = open('test.txt','w') print(s1) f.write(s1) f.close()

单选题 中等

题目描述

已知text.txt中有两行文字,运行以下Python代码说法正确的选项是?(    )

f = open('test.txt','r') 
s1 = f.read() 
f.close() 
f = open('test.txt','w') 
print(s1) 
f.write(s1) 
f.close()

选项(单选)

上一题 下一题