AI题库 · Python编程六级题库
题目分享 #16237
执行以下代码后,file.txt 文件的内容是?( )
with open('file.txt', 'w') as f:
f.write('First line\n')
with open('file.txt', 'a') as f:
f.write('Second line\n')
with open('file.txt', 'r+') as f:
f.seek(0)
f.write('Replaced first line\n')
A
First line Second line
B
Replaced first line Second line
C
First line Replaced first line
D
Replaced first line
AI题库 · 编程考级与信奥赛真题库
查看答案 →
复制链接后可在微信、QQ、小红书等平台粘贴分享;答案与解析在题目页。