1、random.shuffle()打乱列表顺序 # shuffle()使用样例import randomx = [i for i in range(10)]print(x)random.shuffle(x)print(x) 也可以用来随机化index