1-5五个数字随机排序
代码记录,无实际意义
""" 功能:1-5五个数字随机排序 时间:1-10 """
import random
list1 = []
list2 = [random.randint(1, 5)]
while len(list2) < 5:
n = random.randint(1, 5)
list1.append(n)
i = 0
for j in list2:
if n == j:
i += 1
break
else:
i == 0
if i == 0:
list2.append(n)
print(list2)