My while
loop just keeps on going even though I input y, yes, n, or no.
import random
def rollDice():
diceRoll = random.randint(1,6)
return diceRoll
def reRollDie1():
reRollDie1 = input("Would you like to re roll die 1?")
reRollDie1.lower()
while reRollDie1 != "yes" or reRollDie1 != "y" or reRollDie1 != "no" or reRollDie1 != "n":
reRollDie1 = input("Sorry that answer is invalid please try again. Would you like to re-roll die 1? ")
reRollDie1()
OUTPUT:
Sorry that answer is invalid please try again. Would you like to re-roll die 1? no
Sorry that answer is invalid please try again. Would you like to re-roll die 1? yes
Sorry that answer is invalid please try again. Would you like to re-roll die 1? yes