# Improve the User Experience

Copied!
Happy Pythoning!

alex opoku

I have completed the challenge and bleow is my code

``````# Rolle Playing Game
print("Hello welcome to  the role playing game", end ="\n\n")

import random

player_health = 100
monster_health  = 150
heal = 30

while True:
print(f"Health Status: Player= {player_health}, Monster=
{monster_health}", end ="\n\n")

if monster_health > 0 and player_health > 0:
try:
player_strategy = input("Enter a to ATTACK, h to HEAL
and r to RUN AWAY:")
except KeyboardInterrupt:
print("You can't quit by pressing Ctrl+C. Run away
continue
monster_attack_value = random.randint(15,20)

# Player's turn
if player_strategy.lower() == "a":
player_attack_value = random.randint(10,15)

if player_attack_value % 3 == 0:
monster_health = monster_health - 2 *
player_attack_value
print(f"Yippee !!! You dealt monster critical damage
of {2 * player_attack_value}")
else:
monster_health = monster_health -
player_attack_value
print(f"Good strike!!! Monster is dealt a damage of
{player_attack_value}")

elif player_strategy.lower() == "h":

if player_health >= 70:
player_health = 100
else:
player_health = player_health + heal

elif player_strategy.lower() == "r":
player_health = 0
else:
continue

# Monster's turn
if monster_attack_value % 3 == 0:
player_health = player_health - 2 * monster_attack_value
print(f"Oh what a monsterious blow, monster caused a
damage of {2 * monster_attack_value}")
else:
player_health = player_health - monster_attack_value
print(f"What a blow from the monster, causing you5 a
damage of {monster_attack_value}")

else:
if player_health > 0:
print(f"Yippee!!! You've won with {player_health}
points")
else:
print("What a defeat from the monster!")
break
``````