0
py tips for ‘hit miss’ problem
#why does the score not interate correctly? Thanks! score = 100 actions = 4 while actions > 0: if "hit": score += 10 elif "miss": score -= 20 actions -= 1 print(score)
2 Réponses
+ 1
Try it:
score=100
actions= 4
while(actions>0):
if "hit ":
score+=10
else :
score-=20
print(score)