一个文本文件test.txt的一行存储5个整数如下: 1 3 56 67 34 数之间用空格隔开 要读出这些整数的

大学网课 已帮助 人

一个文本文件test.txt的一行存储5个整数如下: 1 3 56 67 34 数之间用空格隔开,要读出这些整数的函数正确的是:

A.def read(): f=open("test.txt","rt") while true: s=f.read() if s!="": print(s) else: break f.close()

B.def read(): f=open("test.txt","rt") s=f.readline() st=s.splist(" ") for s in st: print(s) f.close()

C.def read(): f=open("test.txt","rt") st=f.readlines() for s in st: print(s) f.close()

D.def read(): f=open("test.txt","rt") while true: s=f.readline() if s!="": print(s) else: break f.close()

一个文本文件test.txt的一行存储5个整数如下: 1 3 56 67 34 数之间用空格隔开 要读出这些整数的

热搜:不能将整数型数据转换到文本型数据