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

A21048. 执行以下Python代码后,输出的结果是 '789\n456' 。( )with open('test.txt', 'w') as f: f.write('123\n456') with open('test.txt', 'r+') as f: f.seek(0, 2) f.write('789') f.seek(0) print(repr(f.read()))

判断题 较难

题目描述

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

with open('test.txt', 'w') as f:
    f.write('123\n456')

with open('test.txt', 'r+') as f:
    f.seek(0, 2)
    f.write('789')
    f.seek(0)
    print(repr(f.read()))

选项(单选)

上一题 下一题