py tips for ‘hit miss’ problem | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
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 Antwort
+ 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