Ok so here is the question and feel free to edit it in your way. I just want to know why the if statement after getting input in inp_fg is not working. The program just ends itself after inputting the inp_fg
def fight():
n = 1
ph = stats.user_hp #you can use your own integer values in place of stats.var
pa = stats.user_att
pd = stats.user_df
psta = stats.user_sta
if n == 1:
eh = goblin.health #you can use your own integer values in place of .var
ea = goblin.attack
ed = goblin.defence
def actions():
print("Options:\nEnter 1 to attack\nEnter 1 to run away(costs stamina)")
inp_fg = input()
if inp_fg == 1:
print("ab")
p_ac = random.randit(1, 5)
e_ac = random.randit(1, 5)
eh = eh - p_ac
ph = ph - e_ac
if eh > 0:
actions() # i want if the hp of goblin is greater than 0 then it will start the actions() again
elif eh <= 0:
print("You won")
elif ph == 0:
print("You died")
actions()