试题 试卷
题型:单选题 题类:常考题 难易度:普通
高中信息技术综合库——循环语句1
s=0
For i=1 To 3
s=s+i
Next i
该程序段运行后,变量s的值是( )
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.ConnectionString="provider=Microsoft.ACE.OLEDB.12.0;data sourc="
+App.Path+"\socre.accdb"
Conn.Open
Set rs.ActiveConnection=conn
Rs. Open"Selec*from cj"
n=1
Do While Not rs.EOF
Score(n)=rs.fields("成绩"):Name(n)=rs.fields("姓名")
n=n+1:rs.MoveNext
Loop
下列说法中不正确的是( )
import random
a,i,c=[],0,0
while i<5:
b=random.randint(0,9)
if b not in a:
a.append(b)
i+=1
key=int(input("key="))
for j in range(len(a)):
if a[j]%key==0:
c+=1
else:
a[j-c]=a[j]
print(a)
运行该程序,若输入 key 为2,则输出的a 不可能为( )
a = [34, 12, 93, 8, 14, 18, 24, 17, 51, 57]
num = random.randint(2, 3)
List = []
for i in range(len(a)):
if a[i] % num == 0:
List.append(a[i])
print(List)
执行该程序段后,输出的结果可能是( )
比如:仓库存储情况列表a=["0","A","A","B","B","A","0","0","0"],其中"0"表示空位,"A","B"表示位置上货物种类,现需从中取出一件B货物,则应从右侧取出,取完后,仓库存储列表更新为a=["0","A","A","B","A","0","0","0","0"]。
for i in :
print("*", end="")
s = ['12','22','23','31','123','224']
res =s[0]
for i in range(1,len(s)):
if s[i] >= res:
res =s[i]
print(res)
执行上述程序后,输出的结果是( )
试题篮