如果文件data.txt中的内容是“hello, world”,则p2的输出结果是什么?
题号02:如果文件data.txt中的内容是“hello, world”,则p2的输出结果是什么?
with open('data.txt') as f:
p1 = f.read()
p2 = f.read()
A.hello, world
B.输出为空,因为文件指针已经读到文件尾部
C.hello
D.world
错误答案:A
正确答案:B
题号02:如果文件data.txt中的内容是“hello, world”,则p2的输出结果是什么?
with open('data.txt') as f:
p1 = f.read()
p2 = f.read()
A.hello, world
B.输出为空,因为文件指针已经读到文件尾部
C.hello
D.world
错误答案:A
正确答案:B