求助python循环问题
发布网友
发布时间:2022-05-25 15:01
我来回答
共1个回答
热心网友
时间:2023-11-06 20:51
import random
iRandom = [] #定义随机数列表
color=("East+","South+","West+","North+","Middle+")
listRandom = list(color)
for i in range(5):
random.shuffle(listRandom)
iRandom = listRandom[0:3]
print 'result:',' '.join(iRandom)
---------------------------------