import random a = [1, 2, 3, 4, 5]; random.shuffle(a) print a #[2, 3, 1, 5, 4]
python打乱数组顺序
原文:http://www.cnblogs.com/yongqing/p/7067844.html