import random score = 0 print("Welcome to Dice game") while True: game = input("Start game? (y/n): ") if game.lower() == "n": print("Have a good day!") break elif game.lower() == "y": score = 0 roll_number = 1 while True: print("\nRoll", roll_number, "-------------------") dice1 = random.randint(1, 6) dice2 = random.randint(1, 6) print("You roll", dice1, "and", dice2) if dice1 == 1 and dice2 == 1: print("Snake eyes!!!") print("\nGame Over --------------") print("Your final score:", score) break else: roll_score = dice1 + dice2 score += roll_score print("Your score for this roll is", roll_score) print("Your total score so far is", score) while True: play_again = input("Roll again? (y/n): ") if play_again.lower() == "n" or play_again.lower() == "y": break else: print("Invalid input. Please enter 'y' or 'n'.") if play_again.lower() == "n": print("\nGame Over --------------") print("Your final score:", score) break roll_number += 1