运维网's Archiver
论坛
›
Python
› python 打乱一个数组的简单方法
mingche
发表于 2017-5-3 12:01:56
python 打乱一个数组的简单方法
#coding:utf-8
import random
def f(x,y):return random.randint(1,2)*2-3
a=range(10)
print a
#
a.sort(f)
print a
#
#随机性还不错
页:
[1]
查看完整版本:
python 打乱一个数组的简单方法