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

A61011. 执行以下Python代码后,输出的结果是 '789\n456' 。1 with open('test.txt', 'w') as f

判断题

题目描述

执行以下Python代码后,输出的结果是 '789\n456'

1 with open('test.txt', 'w') as f:
2  f.write('123\n456')
3 with open('test.txt', 'r+') as f:
4  f.seek(0, 2)
5  f.write('789')
6  f.seek(0)
7  print(repr(f.read()))

选项(单选)