import random def roll_dice(): return random.randint(1, 6), random.randint(1, 6) def display_roll(roll_num, dice, cumulative_score): current_roll_score = sum(dice) total_score = current_roll_score + cumulative_score print("Roll", roll_num, ": ", dice[0], "+", dice[1], "=", current_roll_score, "(Total Score: ", total_score, ")") return total_score def snake_eyes_game(): cumulative_score = 0 roll_num = 1 while True: dice = roll_dice() cumulative_score = display_roll(roll_num, dice, cumulative_score) if dice == (1, 1): print("Snake eyes!!!\nGame Over --------------") print("Your final cumulative score:", cumulative_score, "\n") break choice = input("Roll again (y/n)? ").strip().lower() if choice != 'y': print("\nGame Over --------------") print("Your final cumulative score:", cumulative_score, "\n") break roll_num += 1 if __name__ == "__main__": snake_eyes_game()