I really don't know what the whole discussion is but I thought I'd just point out there is no advantage to having it bring out the entire range of possible damages vs just the min/max. In the one rare case it does make a difference, it'd require a 6th argument, which is opponent/your current HP.

In this case, you get a more accurate interpretation of your "true" odds of dealing "enough" damage. But of course, this is still minute differences. I feel like I'm getting the numbers wrong but whatever.

Code:

import argparse
from decimal import *
eff = {
"SESE": 40,
"SE": 20,
"neutral": 10,
"NVE": 5,
"NVENVE": 2.5
}
stb = {
"STAB": 1.5,
"noSTAB": 1
}
parser = argparse.ArgumentParser()
parser.add_argument("Atk", type=int)
parser.add_argument("Def", type=int)
parser.add_argument("Power", type=int)
parser.add_argument("STAB")
parser.add_argument("Effectiveness")
parser.add_argument("HP", type=int)
args = parser.parse_args()
S = stb[args.STAB]
T = eff[args.Effectiveness]
print("possible damages without CH: ");
output = ""
counter = 0
for R in range(217,256):
damage = int( 42 * args.Atk * args.Power )
damage = int( damage / max(1, args.Def) )
damage = int( damage / 50 )
damage = int( damage + 2 )
damage = int( damage * S )
damage = int( damage * T )
damage = int( damage / 10 )
damage = int( damage * R )
damage = int( damage / 255 )
if R == 217: min = damage
if R == 255: max = damage
if damage > args.HP: counter += 1
output += str(damage)
if R == 237: output += " (median)"
if R != 255: output +=(", ")
denom = max - min
numer = args.HP - min
ans = 1-Decimal(numer)/Decimal(denom)
if ans < 0: ans = 0
if ans > 1: ans = 1
print(output)
print "true odds of doing enough damage: ", (Decimal(counter)/Decimal(39))
print "min/max way odds: ", ans

Code:

python asdf.py 298 288 85 STAB neutral 106
possible damages without CH:
95, 95, 96, 96, 97, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104 (median), 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 108, 109, 109, 110, 110, 111, 111, 112
true odds of doing enough damage: 0.3076923076923076923076923077
min/max way odds: 0.3529411764705882352941176471