import random cashInput = int(input("Please enter an amount to stake: \n")) numInput = int(input("Please enter an amount of trials: \n")) initCash = cashInput cash = initCash currentStatus = "win" taxRate = [0.0025, 0.005, 0.01] i = 0 x = 0 wins = 0 losses = 0 while x < numInput: while i < 100: if currentStatus == "win": stakeValue = cash * 0.1 cash = cash - stakeValue elif currentStatus == "loss": stakeValue = cash * 0.5 cash = cash - stakeValue outcome = random.randint(0,1) combinedStake = stakeValue * 2 if outcome == 0: if combinedStake < 10000000: cash += combinedStake - (combinedStake * taxRate[0]) elif combinedStake >= 10000000 and combinedStake < 100000000: cash += combinedStake - (combinedStake * taxRate[1]) elif combinedStake >= 100000000: cash += combinedStake - (combinedStake * taxRate[2]) i += 1 currentStatus = "win" elif outcome == 1: if cash < 250000: i = 100 else: i += 1 currentStatus = "loss" if cash < initCash: losses += 1 elif cash > initCash: wins += 1 x = x + 1 cash = 25000000 i = 0 currentStatus = "win" print("The final tally is", wins, "wins and", losses, "losses", "with a winrate of", (wins/losses) * 100)