def combat(s,h,i = 1):
for i in range(i,4):
if s in h:
print('Right on him! well done.')
return i
elif s not in h:
print("You didn't hit the enemy. Try again.")
shoot_part = input('Shooting: ')
s = shoot_part
i += 1
if i == 3:
print('You are dead')
我写了个小游戏,想要有计算玩家剩余生命的功能,这个能返回剩余的生命值,那我怎么在之后的编程中调用i呢