100-sided dice roll problem When should I stop rolling if it costs $1 for each roll and I earn only the value of the final roll shown on a 100-sided dice roll? My intent is to maximise profit and I have unlimited rolls

I coded this in Python and obtained the following results from 1,000,000 runs for each test:
Test 1: Stopping when throw >= 50:
Average winnings: \$73.07
Minimum winnings: \$35
Maximum throws: 20
Test 2: Stopping when throw >= 87:
Average winnings: \$86.36
Minimum winnings: \$-4
Maximum throws: 92
I tested a few stopping values, and stopping after rolling 87 or higher seemed to give the best results:
Here's my python code:
import random
import numpy as np

def roll_dice():
    return random.randint(1, 100)

def stop(num, throw, limit=50):
    return throw >= limit

def winnings(num, throw):
    return throw - num

win_list = []
max_throws = 0
stop_at = 50
for run in range(1000000):
    for i in range(1, 101):
        throw = roll_dice()
        if stop(i, throw, stop_at):
            break
    win_list.append(winnings(i, throw))
    max_throws = max(max_throws, i)
print(f'Stopping when throw >= {stop_at}')
print(f'Average winnings: ${np.mean(win_list):.2f}')
print(f'Minimum winnings: ${np.min(win_list)}')
print(f'Maximum throws: {max_throws}')

