发红包

def red_packets(money, num):
    import random
    lst = [0, money * 100] + random.sample(range(1, money * 100,), num - 1)
    lst.sort()
    return ((lst[i + 1] - lst[i]) / 100 for i in range(num))
ret = red_packets(100, 10)
posted @ 2019-08-20 15:59  怀心抱素  阅读(178)  评论(0编辑  收藏  举报