+ 3
What is the error for?
5 Respostas
+ 9
@Rapheal: Even I'm not good at Python, still making my best attempt. That depends on when you want the player's health to be decreased. Just terminate the loop (using break) as soon as the health becomes 0 and ask the user if he wants to play the game again.
For some information on break,
https://www.programiz.com/python-programming/break-continue
# Something like :
if health == 0:
break
+ 11
Just remove the indentation at line 48 and 49 i.e bring both the print statements to the extreme left. Another problem is time limit exceeded, which is because your code runs forever. You need to stop it somewhere.
+ 2
I know, I still haven't reached that part..Thanks anyway!
+ 1
I'm actually pretty new to coding and Python in general.. How would I close the loop and still repeat the whole "turns" loop until someone looses all his health?
+ 1
Thanks