+ 2
[Solved]Python - why "Game Over" never get printed?
Could you help me figure out why"Game Over" never get printed out? https://code.sololearn.com/cl4mS2SxBJiM/?ref=app
2 Antworten
+ 5
See line number 7 your condition here you pass two value one is string type another one 3 and u calling function 3 time
After if condition value are decrementing by 1
if self._lives > 0:
self._lives -= 1
Initially value was 3 in First call then value decrement now value is 2 then again decrement then 1 again decrement but now
Your condition is failed
Becz value is always greater than 0 pass as a argument instead of 3 pass 2 u will see game over will print one times
+ 3
Oh..... I got it! I'm so bad at counting lol. Thank you @Inactive