- 3
Help it is impossible
Z=100 while Z>=0 : if("miss"): Z=Z-20 if("hit"): Z=Z+10 print(Z)
8 odpowiedzi
+ 2
Ryad Âhméd, [Edited]
You may want to re-visit this lesson: https://www.sololearn.com/learning/2277/
If you still face problem, feel free to share the original question.
+ 1
In Python, all letters are interpreted as True, you can check this:
print(bool("miss")) #>>> True
print(bool("hit")) #>>> True
As a result, with each iteration, Z will decrease by 10 until it becomes less than 0.
P. S: "Add python tag to your question".
+ 1
Your code won't work since "miss" and "hit" will always evaluate to a True statement.
0
You’ve made mistake in the if else statement man! Revise your if/else lesson.
Or add what are you trying to do
0
Pranto how can i solve?
0
Use if else and also you want to Z-=20 and Z+=10
0
unable to understand miss and hit variable of if condition. If you clear it then, i will try to solve it
- 3
Shamima Yasmin how i already shared on discussing section