I am trying to make a text based game using the def tool to make an easy loop. However i am unable to have it when the player dies, the player is asked if they wish to play again, and the loop restarts. I have changed the code so that when the player dies, playAgain = "n" so the loop ends but it still does nothing. is it because it's a global variable and i'm trying to affect it with a local variable? If so how could i fix it?
playAgain = "y"
while playAgain == "y" or playAgain == "yes" :
displayIntro()
choosePath()
checkPath()
NextSteps()
Reaction()
attackCHOICE()
if playAgain != "y" or playAgain != "yes":
time.sleep(1)
print()
delayprint("Do you want to play again? ")
playAgain = input()