import random list = [20, 16, 10, 5]; random.shuffle(list) print "Reshuffled list : ", list; random.shuffle(list) print "Reshuffled list : ", list;
运行结果如下:
import random list = [20, 16, 10, 5]; random.shuffle(list) print "Reshuffled list : ", list; random.shuffle(list) print "Reshuffled list : ", list;
运行结果如下: