"Jason MacFiggen" wrote
Python keeps looping when it gets past the int 0, how do I end the
program
when it the int 0 or > 0.
while True:
if mo_hp < 0:
print "The Lich King has been slain!"
elif my_hp < 0:
/etc...
When using a while True loop you need ttto have a
"Jason MacFiggen" wrote in message
news:aanlktinevw8zje7fxktomks+tbrp=trmb7sb7pbkt...@mail.gmail.com...
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.randrang
Jason
Are you trying to prevent negative numbers?
Ben
--- On Wed, 7/28/10, Jason MacFiggen wrote:
From: Jason MacFiggen
Subject: [Tutor] Python Help - How to end program
To: tutor@python.org
Date: Wednesday, July 28, 2010, 9:01 PM
Python keeps looping when it gets past the int 0, how
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