第28395题 单选题
下列关于Python文件seek()方法的操作中,在文本模式下合法且能达到预期效果的是?

已知我们通过with open('demo.txt', 'w', encoding='utf-8') as f_txt: f_txt.write('abcdefgh')创建了文件并写入内容,随后执行以下代码片段:

with open('demo.txt', 'r', encoding='utf-8') as f_txt:
    f_txt.read(3)  # 读取前3个字符,此时文件指针位于索引3处
    # 执行以下某一选项的seek操作后,调用f_txt.read(2)将得到'fg'

那么可以插入的合法操作是?

{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析