Python是强大的数据处理工具,能方便读写文件。 打开D:\test.csv,文件的内容如下图所示, >>>f=open(r"D:\test.csv",'r') >>>s1=f.read() >>>s2=f.read() >>>f.close() 运行上述程序,说法正确的是?( )
【喵呜刷题小喵解析】题目中给出的文件内容没有给出,但根据选项可以推测,文件内容可能包含了 "hello python!" 和 "hello word!" 这两行文本。根据文件读取的规则,使用`f.read()`一次只能读取到文件的一行内容。所以,第一次读取`s1`为 "hello python!",第二次读取`s2`为 "hello word!"。因此,选项C“s1为'hello python!',s2为'hello word!'”是正确的。