py tips for ‘hit miss’ problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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
1 Answer
+ 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