Home > Back-end >  while loop could not break
while loop could not break

Time:07-31

why while loop is not ending please help to find the problem

this program is for dice roll in pyhton I want to roll the dice with no exception but there are exception accured


rand_num=random.randint(1, 6)
game_is_on=True    
while True:
    try:
        user=int(input("What's your choice : "))
        continue
    except:
        print("Please Enter 1-6")

    if user == rand_num:
        print("\t congrats ! \n You guessed it right            
  • Related