random.shuffle(lst) 函数将输入的列表lst随机打乱,会将原序列打乱
import random
lst = ['PEK', 28, 'Li Bai', 'Tsinghua']
random.shuffle(lst)
print(lst)
# ['Tsinghua', 28, 'Li Bai', 'PEK']
random.shuffle(lst) 函数将输入的列表lst随机打乱,会将原序列打乱
import random
lst = ['PEK', 28, 'Li Bai', 'Tsinghua']
random.shuffle(lst)
print(lst)
# ['Tsinghua', 28, 'Li Bai', 'PEK']