import random
list = [20, 16, 10, 5];
random.shuffle(list)
print "Reshuffled list : ", list;
random.shuffle(list)
print "Reshuffled list : ", list;
运行结果如下:
![](https://www.icode9.com/i/l/?n=20&i=blog/1523891/202110/1523891-20211026174732400-1400602134.png)
标签:10,shuffle,python,打乱,random,list,数组,print,Reshuffled
来源: https://www.cnblogs.com/lxz123/p/15466987.html