So it's like a dice roll game and like I'm getting stuck on a loop and I'm not sure how to fix it

26 Views Asked by At

It keeps messing up on the loop it either does nothing, does the command over and over, or does it twice? These are just things that happen when I tried to do it myself

reapting an if statement, adding a while, finding a random related thing I thought would help. the code import random import time

ans=input("Do you roll a dice? Y/N ")
if ans in ("N", "n"):
    print("Then when did you click this game?")
else:
    dr=random.choice("123456")
    time.sleep(1.7)
    print("You got a "+dr)
again = input("Do you want to roll again? Y/N ")
while again in ("y", "Y"):
           dr=random.choice("123456")
time.sleep(1.7)`
print("You got a "+dr)
again = input("Do you want to roll again? Y/N ")
0

There are 0 best solutions below