>>>from random import randint
>>>randint(1,6)
3
他将两个整数作为参数,并随机返回一个位于这两个整数之间的整数。
-----------
>>>from random import choice
>>>players['charles', 'martina', 'michael', 'florence']
>>>first_up = choice(players)
>>>first_up
'florence'
choice()将一个列表或元组作为参数,并随机返回其中的一个值。