好吧,所以我差不多完成了這件事。所以我被困在一個雙循環中,打印後沒有打印(贏錢),所以有些東西不對,但我不確定有什麼問題,但是這裏是代碼。而且它沒有爲單個玩家存儲筆記或提醒或積分。如果任何人都可以幫助我,我將不勝感激。Point.py打印,但停止打印
winnings = []
for n in range(len(ratios)):
winnings.append(pot*ratios[n])
print(winnings) #STOPS HERE
for winning in winnings[1:]:
# loop over all but the first element in winnings
winning = int(winning)
for i, player in enumerate(players[1:]):
# loop over all but the first player, adding indices
notes.store("~lottery~", player, "The system has placed you %s in the lottery. The lottery awarded you %s P$" % (Point.ordinal(i), winning), time.time())
alerts.append(player)
point = Point.dPoint[player] + winning
Point.dPoint[player] = point
return True
elif len(players) == 0:
「贏」是長度爲1的列表,也許? –
那麼當我測試它時,獎金列表中只有1件東西,所以是的。 – user3103923