參考參考http://docs.python.org/lib/module-random.html
[root@localhost test]# python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
>>> random.randint(0,99)
74
>>>
[root@localhost test]# python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
>>> items = [0,1,2,3,4,5,6,7,8,9]
>>> random.shuffle(items)
>>> items
[7, 2, 8, 9, 4, 0, 3, 5, 6, 1]
>>>