この特定の「else」で構文エラーが発生し続けます。何が問題なのかわかりません。まだ十分に明確でない場合は、16 行目の else です。数日前に Python を始めたばかりです。ですから、手のひらを強く向けないでください。
W = 1
while W == 1:
if MH > 0:
PlayerInput = input("Attack, Defend, or Run('1','2',or'3'):")
if PlayerInput == "3":
W = 0
elif PlayerInput == "1": #Attack
Atk = randint(1,4)
if Atk == 1:
Atk = randint(1,4)
if Atk == 1:
print ("Miss")
else:
MH = MH-((1/2)*FightingAbility)
print ("Enemy lost %s Health" % ((1/2)*FightingAbility)
else:<<<<---------[[This else is giving me trouble]]
MH = MH-Fightingability
print ("Enemy lost %s Health" % (FightingAbility))
elif PlayerInput == "2": #Defend
if S > FightingAbility: #Enemy is stronger
Def = randint(1,4)
if Def == 1:
Def = randint(1,4)
if Def == 1:
print ("The %s Missed" % (E))
else:
Health = Health-((1/2)*S)
print ("You lost %s Health" % ((1/2)*S)
else:
Health = Health-S
print ("You lost %s Health" % (S))
elif S <= FightingAbility: #Enemy is weaker
Def = randint(1,4)
if Def == 1:
Def = randint(1,4)
if Def == 1:
Health = Health-S
print ("You lost %s Health" % (S))
else:
Health = Health-((1/2)*S)
print ("You lost %s Health" % ((1/2)*S)
else:
print ("The %s Missed" % (E))
else:
Win=1
pass