Cant stop the program repeating using "while" loop... Python
Question: Here's what i have so far... if you run the module and choose to play it
simply repeats the dice throw infinitely. Help?

    
    
    answer=input("Would you like to play? Answer Y/N: ")
    
    while answer == "Y" or answer == "y" or answer == "yes": 
        import random
        die=random.randint(1,6)
    
        dieTwo=random.randint(1,6)    
    
        if die== 1:
            print("XXXXXXX")
            print("X     X")
            print("X  O  X")
            print("X     X")
            print("XXXXXXX")
            print("You rolled a one...")
        if die== 2:
            print("XXXXXXX")
            print("X   O X")
            print("X     X")
            print("X O   X")
            print("XXXXXXX")
            print("You rolled a two...")
        if die== 3:
            print("XXXXXXX")
            print("X   O X")
            print("X  O  X")
            print("X O   X")
            print("XXXXXXX")
            print("You rolled a three...")
        if die== 4:
            print("XXXXXXX")
            print("X O O X")
            print("X     X")
            print("X O O X")
            print("XXXXXXX")
            print("You rolled a four...")
        if die== 5:
            print("XXXXXXX")
            print("X O O X")
            print("X  O  X")
            print("X O O X")
            print("XXXXXXX")
            print("You rolled a five...")
        if die== 6:
            print("XXXXXXX")
            print("X O O X")
            print("X O O X")
            print("X O O X")
            print("XXXXXXX")
            print("You rolled a six...")
    
        if dieTwo==1:
            print("XXXXXXX")
            print("X     X")
            print("X  O  X")
            print("X     X")
            print("XXXXXXX")
            print("and a one")
        if dieTwo==2:
            print("XXXXXXX")
            print("X   O X")
            print("X     X")
            print("X O   X")
            print("XXXXXXX")
            print("and a two")
        if dieTwo==3:
            print("XXXXXXX")
            print("X   O X")
            print("X  O  X")
            print("X O   X")
            print("XXXXXXX")
            print("and a three")
        if dieTwo==4:
            print("XXXXXXX")
            print("X O O X")
            print("X     X")
            print("X O O X")
            print("XXXXXXX")
            print("and a four")
        if dieTwo==5:
            print("XXXXXXX")
            print("X O O X")
            print("X  O  X")
            print("X O O X")
            print("XXXXXXX")
            print("and a five")
        if dieTwo==6:
            print("XXXXXXX")
            print("X O O X")
            print("X O O X")
            print("X O O X")
            print("XXXXXXX")
            print("and a six")
    print("")
    
    if answer=="N" or answer=="n" or answer=="no":
        print("Thank you for playing.")
    


Answer: Why would you expect this to be anything but an infinite loop? You have a
`while` loop that checks for your condition, and this condition will always be
true because you never change `answer`

You could also make a function for printing your dice, and instead of using
`or` you can use `answer in ("Y", "y", "yes")` as one example if you wanted to
be terser in places where you have conditions like this.

