Python keeps looping when it gets past the int 0, how do I end the program
when it the int 0 or > 0.
my_hp = 50
mo_hp = 50
my_dmg = random.randrange(1, 20)
mo_dmg = random.randrange(1, 20)
endProgram = end()
while True:
if mo_hp < 0:
print "The Lich King has
I am have trouble figuring out how to make my program stop at 0 hit
points if I run it, it always goes into the negative hitpoints...
So my question is how do I make this program end at exactly 0 hit points
every time instead of going over?
and also, what can I do instead of writing print so
Can anyone tell me how to fix the errors I am getting if possible? I'm quite
new and so confused...
also how do I display the winner under the displayInfo function?
import random
def main():
print
playerOne, playerTwo = inputNames(playerOne, PlayerTwo)
while endProgram == 'no':
I was wondering how can I change sys.exit so if you use command line to run
the program. it prompts a message asking if the user wants to exit instead
of automatically just exiting?
import random
import sys
my_hp = 50
mo_hp = 50
menu1 = """
Menu Selections:
1 - Attack
My problem is choice 3. Exit, if you select no or put an invalid answer...
It will run menu1... but then it runs
name = raw_input ("Enter your character name. ")
print "Your character name is:", name
How can i make it so it prints menu1 like normal... then asks you to enter
your selection