I'm currently making a game for CompSci class, and I want to shorten our random monster fights. Is there a way to make it so when I call a def I can change the name depending on a random variable? This is the snippet I'm talking about
Loop = True
MonsterType = random.randint(1,20)
Monster*()
battle()
I have
def Monster1
def Monster2
def Monster3
.
.
.
def Monster20
I want the * in the first snippet to be the variable MonsterType, is there a way to have it do that? I.e. When it runs, if MonsterType = 15, then it'll be Monster13() that's called.