概述
试试这个:def pTurn(CampLoc, AICampLoc, score, yourHits, cHits):
if yourHits < 5:
#^This line ident is probably the offending line. ;)
hGuess = int(raw_input("Enter a co-ordinate to air-strike: "))
print "Air-striking co-ordinate: %d" % hGuess
for cSpot in AICampLoc:
if hGuess == cSpot:
yConfirMsg = "Kill confirmed!!"
yourHits += 1
score += 100
AICampLoc.remove(hGuess)
break
else:
yConfirMsg= "No casualties"
score = score #You may want to fix this, since the logic doesn't make sense
yourHits = yourHits #Fix this line as well. This is variable value assignment to the same variable.
如果这不起作用,另一件要考虑的事情是,在缩进代码的前导空格时,可能会无意中混合使用制表符和空白。如果是,请将所有选项卡转换为空格。
关于引用的注释。也许你是想回报那些价值观?如果是的话,你需要修
最后
以上就是潇洒咖啡豆为你收集整理的pythonfor循环if中断怎么使用_python在for循环中中断if语句的全部内容,希望文章能够帮你解决pythonfor循环if中断怎么使用_python在for循环中中断if语句所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复