下面代码的输出结果是 a=[] for i in range(2,10): count=0 for x in range(2,i一1): if i%x==0: count+=1 if count==0: a.append(i) print(a)

admin2019-09-02  34

问题 下面代码的输出结果是
a=[]
for i in range(2,10):
count=0
for x in range(2,i一1):
if i%x==0:
count+=1
if count==0:
a.append(i)
print(a)

选项 A、[3,5,7,9]
B、[2,4,6,8]
C、[2,3,5,7]
D、[4,6,8,9,10]

答案C

解析
转载请注明原文地址:https://kaotiyun.com/show/U36p777K
0

最新回复(0)