抢红包 以及 手气最佳问题
抢红包问题
# 输入总金额以及红包数,随机分配红包里的金额
from random import uniform
money = float(input('please enter the total money: '))
people = int(input('please enter the number of people: '))
def red_packet(money,people,types='r'):
result = []
if types=='u':
temp = money/people
real_money = float('%.2f'%(temp))
last = money-real_money*(person-1)
result = [real_money]*(people-1)
result.append(last)
else:
count = 1