When you call a random number, the function return a single value. Hence your error. You need to come up with a way of calling the function every time you want a new value.
There is something clever that you can do that requires decorators that I will show below.
def recall_last(func):
def _inner(*args, **kwargs):
if args:
func.last_dealt = func(*args,**kwargs)
else:
func.last_dealt = getattr(func,'last_dealt',0)
return func.last_dealt
return _inner
@recall_last
def rand_damage(*args):
return random.randrange(*args)
This code will return a new value every time you pass it an lower and upper bound to use in the randrange
function. If nothing is passed, then it returns the last value generated. Then this would work in your code
if deskemon_selection_input == "1":
deskemon = "TIMOSHA"
my_health = 500
my_damage = (20, 25)
my_defense = random.randrange(10, 15)
my_specialattack = 0
print("You have selected TIMOSHA as your Deskemon")
deskemon_selection_loop = False
....
jack_health = (jack_health + jack_defense) - rand_damage(*my_damage)
print(deskemon + " HAVE INFLICTED " + str(rand_damage()) + " TO CHIPHEAD")