0
HELP
Here is my code Health = 50 EHealth = 50 Alive = 1 print("Hi") def Fight(): while 1 == 1: if 50 >= 0: print("You died") Alive = 0 break if EHealth <= 0: print("You killed the enemy") Alive = 1 break Fight print("bye") The code basically ignores the function. What am I doing wrong?
1 Réponse
+ 1
I'm no Python expert, but I suppose you have to call the method with parentheses, e.g. Fight() (correct me if I'm wrong, though).
Also, 50 is always bigger than 0, so the first if-statement is the one that is always executed. Maybe you meant "Health" there?