红包demo

嘿嘿,红包demo

import random

dic={}
lis=['KeLan','MonKey','Dexter','Superman','Iron Man','Robin'] def redpacket(cash,person,index):
if cash>0 and person!=1:
n=round(random.uniform(0.01,cash-(0.01*person)),2)
dic[lis[index]]=n
print(str(n).ljust(4,""))
person-=1
cash-=n
index+=1
redpacket(cash,person,index)
else:
dic[lis[index]]=round(cash,2)
print(str(cash).ljust(4,""))
redpacket(10,len(lis),0)
print(dic)
print("手气最佳:",max(dic.items(),key=lambda x:x[1]))
上一篇:java截取字符串中的数字


下一篇:IDA插件栈字符串识别插件