Мне нужно показать максимальную сумму денег в банке, но я всегда получаю «0» или, когда я пытаюсь внести их в список, это не работает. Остальная часть программы работает нормально, но я просто не знаю, как показать максимальную сумму денег, которая была в куче денег. вот мой код:
import random
def main():
"""
param: None
return: None
"""
print("Welcome to Lucky Sevens! Take your chances and win big if the die equal to 7! There are many ways to win!")
pot_money = 0
initial_bet = float(input("Enter your bet: "))
die1 = random.randint(1,6)
die2 = random.randint(1,6)
diceTotal = die1 + die2
roll_number = 0
#pot money would be equal to the initial bet until the player starts to gamble or it is empty
pot_money = initial_bet + pot_money
while pot_money > 0:
diceTotal = die1 + die2
roll_number += 1
print("Die 1 was " + str(die1) + " and die 2 was " + str(die2))
print("The total of the die was: " + str(diceTotal))
print("You are currently on roll " + str(roll_number))
if diceTotal == 7:
pot_money = pot_money + 4
else:
pot_money = pot_money - 1
if pot_money == 0:
print("It took " + str(roll_number) + " rolls to break you.")
print("The maximum amount of money in the pot was " + max(str(pot_money)))
print("The pot currently holds: $" + str(pot_money))
die1 = random.randint(1,6)
die2 = random.randint(1,6)
main()