11
随机根本就不是随机的吗?
我这样做是为了测试randint的随机性: >>> from random import randint >>> >>> uniques = [] >>> for i in range(4500): # You can see I was optimistic. ... x = randint(500, 5000) ... if x in uniques: ... raise Exception('We duped %d at iteration number %d' % (x, i)) ... uniques.append(x) ... Traceback (most …