打乱一个列表的元素

import random

a = [1, 2, 3, 4, 5]
random.shuffle(a)
print(a)

猜你喜欢

转载自blog.csdn.net/Da___Vinci/article/details/92806785