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)

18th Feb 2021, 1:49 PM
Kaiaiak
Kaiaiak - avatar
2 Antworten
+ 1
Try it: score=100 actions= 4 while(actions>0): if "hit ": score+=10 else : score-=20 print(score)
18th Feb 2021, 2:17 PM
Talha Jubayer
Talha Jubayer - avatar