<div>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... </div>
<div> </div>
<div>So my question is how do I make this program end at exactly 0 hit points every time instead of going over?</div>
<div> </div>
<div>and also, what can I do instead of writing print so many times?</div>
<div>    </div>
<div>import random</div>
<div>    my_hp = 50<br>    mo_hp = 50<br>    my_dmg = random.randrange(1, 20)<br>    mo_dmg = random.randrange(1, 20)<br>    while True:<br>        if mo_hp &lt; 0:<br>            print &quot;The Lich King has been slain!&quot;<br>
        elif my_hp &lt; 0:<br>            print &quot;You have been slain by the Lich King!&quot;<br>        if mo_hp &lt;= 0:<br>            break<br>        elif my_hp &lt;= 0:<br>            break<br>        else:<br>            print &quot;Menu Selections: &quot;<br>
            print &quot;1 - Attack&quot;<br>            print &quot;2 - Defend&quot;<br>            print<br>            choice = input (&quot;Enter your selection. &quot;)<br>            choice = float(choice)<br>            print<br>
        if choice == 1:<br>            mo_hp = mo_hp - my_dmg<br>            print &quot;The Lich King is at &quot;, mo_hp, &quot;Hit Points&quot;<br>            print &quot;You did &quot;, my_dmg, &quot;damage!&quot;<br>
            print<br>            my_hp = my_hp - mo_dmg<br>            print &quot;I was attacked by the lk for &quot;, mo_dmg,&quot; damage!&quot;<br>            print &quot;My Hit Points are &quot;, my_hp<br>            print<br>
        elif choice == 2:<br>            mo_hp = mo_hp - my_dmg / 2<br>            print &quot;The Lich King is at&quot;, mo_hp, &quot;Hit Points&quot;<br>            print &quot;you did &quot;, my_dmg / 2, &quot;damage!&quot;<br>
            print<br>            my_hp = my_hp - mo_dmg<br>            print &quot;I was attacked by the lk for &quot;, mo_dmg,&quot; damage!&quot;<br>            print &quot;My Hit Points are &quot;, my_hp<br>            print</div>

<div> </div>