天天看點

Python 将有序list打亂随機排序

from random import shuffle
l = [1, 2, 3, 4, 5]
shuffle(l)
print(l)
# [2, 3, 4, 5, 1]