输入学生姓名,增加到一个列表st中,直到输入的姓名为空为止,最后输出st。s=[]while True:s=input()if s!="":__________else:breakprint(st)
A: s.append(st)
B: st.add(s)
C: st.insert(s)
D: st.append(s)
A: s.append(st)
B: st.add(s)
C: st.insert(s)
D: st.append(s)
举一反三
- 输入学生姓名,增加到一个列表st中,直到输入的姓名为空为止,最后输出st。 st=[] while True: s=input() if s!="": __________ else: break print(st)
- 个文本文件test.txt的一行存储5个整数如下:1 3 56 67 34数之间用空格隔开,要读出这些整数的函数正确的是: A: def read():f=open("test.txt","rt")st=f.readlines()for s in st:print(s)f.close() B: def read():f=open("test.txt","rt")while true:s=f.read()if s!="":print(s)else:breakf.close() C: def read():f=open("test.txt","rt")while true:s=f.readline()if s!="":print(s)else:breakf.close() D: def read():f=open("test.txt","rt")s=f.readline()st=s.splist(" ")for s in st:print(s)f.close()
- 一个文本文件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") while True: s=f.readline() if s!="": print(s) else: break 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") s=f.readline() st=s.splist(" ") for s in st: print(s) f.close()
- 要把st变成st=['x','a','b'],那么操作是st=['a','b']_____print(st) A: st.append('x') B: st.insert(1,'x') C: st.insert('x') D: st.insert(0,'x')
- 抵补利率平价公式是 A: Pd=S* Pf B: (St - St -1) / St -1 =(πd –πf) / (1+πf) C: SE=S* (1+id) / (1+if) D: F=S* (1+id) / (1+if)