微信发红包

def lucky_money(money,numble):
    res = random.sample(range(1,money*100),numble-1)
    res.sort()
    res.insert(0,0)
    res.append(money*100)
    for i in range(len(res)-1):
        m = res[i+1] - res[i]
    yield m/100

g = lucky_money(100,10)
a = 0
for i in g:
    print(i)
posted on 2018-09-05 22:02  summer-rain  阅读(92)  评论(0编辑  收藏  举报