Python程序如下:
from random import random a=[0]*7 flag=[False]*10 i=1 while i<=6: a[i]=int(random()*5)*2+1 if flag[a[i]]==False or a[i]>a[i-1]: flag[a[i]]=True i=i+1
该程序段运行后,列表a的值可能为?
[0, 7, 5, 9, 7, 1, 7]
[0, 1, 3, 5, 7, 9, 1]
[0, 9, 2, 3, 5, 7, 5]
[0, 9, 5, 9, 7, 9, 1]