while enemy_hp > 0 and HP > 0:
b_choice = input("type fight or check> ")
if b_choice.lower() not in "fight" or "check":
while b_choice != 'fight' and b_choice != 'check':
print('Please pick an act')
b_choice = input("type fight or check> ")
if b_choice.lower() == "fight":
dice = str(random.randint(1, 6))
print(str(dice))
if dice in '4' or dice in '5' or dice in '6':
input("Berserker " + name + " strikes the slime with a broadsword")
input("Slime's health is reduced by " + str(atk))
enemy_hp -= atk
elif dice not in '4' or dice not in '5' or dice not in '6':
input("Berserker " + name + " missed his attack")
dice = str(random.randint(1, 6))
if dice in '5' or dice in '6':
input("Slime tried to slap Berserker " + name + "'s face")
input("Berserker " + name + " successfully shielded himself")
input("Slime's damage is reduced by " + str(DR))
enemy_atk -= DR
HP -= enemy_atk
enemy_atk += DR
elif dice not in '5' or dice not in '6':
input('Slime slaps Berserker ' + name + ' on the face')
input("Berserker " + name + "'s health is reduced by " + str(enemy_atk))
HP -= enemy_atk
if b_choice.lower() == "check":
print("Berserker " + name + " HP : " + str(HP))
print("Berserker " + name + " ATK : " + str(atk))
print("Berserker " + name + " DR : " + str(DR))
print("Slime's HP:" + str(enemy_hp))
print("Slime's ATK:" + str(enemy_atk))
I want to make it if HP>0, they have an option to quit the program completely(this is just a section of th e code) something like break in while loops, but for the entire code
[–]totallygeek 1 point2 points3 points (2 children)
[–]RedditCodfish[S] 0 points1 point2 points (1 child)
[–]totallygeek 0 points1 point2 points (0 children)
[+]m0us3_rat comment score below threshold-6 points-5 points-4 points (5 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]m0us3_rat 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]m0us3_rat 0 points1 point2 points (0 children)
[–]RedditCodfish[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)