import random k = random.sample(xrange(0x41, 0x5b), 26) print k import random k = random.sample(xrange(0x41, 0x5b), 26) print k k = [chr(x) for x in k] print k v = random.sample(xrange(1000000), 26) print v d = dict(zip(k, v)) print d 输出结果 </pre><
If is a discrete random variable taking on values , then we can write . Implementation of this formula to generate discrete random variables is actually quite straightforward and can be summarized as follows. To generate , Generate if , set . we defi