0

Please help me ! I am newbie. what's my wrong ?

shots=4 result=input() score=100 while shots > 0: if result=="hit": score +=10 shots -=1 elif result=="miss": score -=20 shots -=1 shots = shots - 1 print(score) when hit(+10), miss(-20). 4 shot. Its not working

15th Mar 2021, 12:55 PM
Hậu Trần Văn
Hậu Trần Văn - avatar
1 Odpowiedź
+ 1
Don't make duplicate question https://www.sololearn.com/discuss/2725735/?ref=app shots=4 score=100 while shots > 0: result=input() if result=="hit": score +=10 elif result=="miss": score -=20 shots = shots - 1 print(score) You take input only one time. It should take 4 times. And you decrease shot by 2. It should decrease by 1.
15th Mar 2021, 1:04 PM
Vadivelan