我是 Python 新手。
我不断收到代码的 if 语句周围的缩进错误。if/else 语句的第一块读取良好。第二个块导致缩进错误。当我删除它进行调试时。第三块(最后)也返回缩进错误。...但我不确定在哪里可以找到它们?
关于出了什么问题的任何建议?
# Begin Fight/Conditions for Ending
while Player.hp > 0 and Marco.hp > 0:
while playerchoice not in [1,2,3,4]:
playerchoice = input("\n Which move would you like to use: ")
marcochoice = random.choice([1,2,3,4])
# Making the Moves - Player Always Goes First (For now!)
if playerchoice == 1:
Player.jabs(Marco)
#print("\n Player - jabs - Debug")
elif playerchoice == 2:
...
else:
#print("Player - Non-Choice - Debug")
# Marco's Turn!
if Marco.hp > 0:
if marcochoice == 1:
Marco.jabs(Player)
#print("Marco - Jabs - Debug")
...
else:
#print("Marco - Non-Choice - Debug")
else:
pass
# Ending Conditional
if Marco.hp <= 0 and Player.hp <= 0:
print("It's a draw!")
...
else:
print("Something has gone horribly wrong!")