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

A60595. 执行以下代码后,file.txt 文件的内容是?( )with open('file.txt', 'w') as f

单选题

题目描述

执行以下代码后,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')

选项(单选)