holiday_python
发表于 2021-4-28 17:57:48
学习
白本羽
发表于 2021-5-15 21:44:37
本帖最后由 白本羽 于 2021-5-15 21:46 编辑
import random
num = 10
money = 100
dict1 = {}
while money != 0:
for each in range(num):
dict1 = random.randint(1, money)
money -= dict1
if money <= 0:
for i in range(len(dict1.values()),num):
dict1 = "抱歉!手速不够快,下次再来吧!"
break
for member in dict1.values():
if type(member) == str:
print(member)
else:
print("您的红包金额为%s元" % member)
对欧皇友好,对非酋敌视的写法{:5_97:}
您的红包金额为100元
抱歉!手速不够快,下次再来吧!
抱歉!手速不够快,下次再来吧!
抱歉!手速不够快,下次再来吧!
抱歉!手速不够快,下次再来吧!
抱歉!手速不够快,下次再来吧!
抱歉!手速不够快,下次再来吧!
抱歉!手速不够快,下次再来吧!
抱歉!手速不够快,下次再来吧!
抱歉!手速不够快,下次再来吧!